Document last updated 2022-02-22 22:21:42 by Rebecca Shaftel ().

This report summarizes the thermal sensitivity results and draft predictive model for team meeting on February 4, 2022. Goals of the meeting are to discuss model inputs and methods and prediction scenarios.

Objectives:

  1. Build a predictive model for stream thermal sensitivity (TS).
  2. Develop scenarios to understand effects of warming stream temperatures on subsistence salmon populations.

The project mapper is updated with TS by year linked to sites and layers showing a lot of the input data and various hydrologic layers.

1 Thermal sensitivity

DFA output were biased for some years because most of the sites (half or more) came from one watershed with high thermal sensitivity. For some reason, the pattern in these sites all appeared on the trend and their TS was really low.

dfa_dat <- read_csv("DFA/output_8Nov21/GlobalModelEstimates_1trend_DUE.csv")
trend_dat <- read_csv("DFA/output_8Nov21/GlobalTrends_1trend_DUE.csv")

dfa_dat %>% 
  ggplot(aes(TempSens)) +
  geom_freqpoly(aes(color = Region)) +
  facet_wrap(~Year)

trend_dat %>% 
  ggplot(aes(x = DOY, y = Trend)) +
  geom_line() + 
  facet_wrap(~Year)

As an alternative modeling method to estimate stream thermal sensitivity, Tim used the air temperature coefficient in a time series model for each site and summer using an auto-regressive lag of 1 day on the residuals (AR1 model). These results better matched the patterns between air-stream temperatures at the different sites.

mod_dat <- readRDS("data_preparation/final_data/model_data2022-02-08.rds")

mod_dat %>% 
  ggplot(aes(TempSens)) +
  geom_freqpoly(aes(color = Region)) +
  facet_wrap(~Year)

2 Relationships between TS and covariates

panel.cor <- function(x, y, digits = 2, prefix = "", cex.cor, ...)
{
    usr <- par("usr"); on.exit(par(usr))
    par(usr = c(0, 1, 0, 1))
    r <- abs(cor(x, y))
    txt <- format(c(r, 0.123456789), digits = digits)[1]
    txt <- paste0(prefix, txt)
    if(missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
    text(0.5, 0.5, txt, cex = cex.cor * r)
}

panel.hist <- function(x, ...)
{
    usr <- par("usr"); on.exit(par(usr))
    par(usr = c(usr[1:2], 0, 1.5) )
    h <- hist(x, plot = FALSE)
    breaks <- h$breaks; nB <- length(breaks)
    y <- h$counts; y <- y/max(y)
    rect(breaks[-nB], 0, breaks[-1], y, col = "cyan", ...)
}

mod_dat %>% 
  select(TempSens, log_slope, log_cat_elev, log_cat_slope, 
         wtd_slope_MEAN, snow_ind, wtd_lcld_jd, summer_precip) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

mod_dat %>% 
  select(TempSens, log_area, dist_coast_km, wtd_north_per,
         asrt_wet, asrt_glac, asrt_lake, glac_10) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

Exploring interactions between covariates and TS. Starting with different variables and mean watershed slope.

facet_var <- "wtd_slope_MEAN"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = wtd_north_per, color = Region)) +
  geom_smooth(aes(y = TempSens, x = wtd_north_per), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by mean watershed slope and north aspect", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_slope_MEAN"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = asrt_glac, color = Region)) +
  geom_smooth(aes(y = TempSens, x = asrt_glac), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by mean watershed slope and glacier cover", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_slope_MEAN"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = asrt_lake, color = Region)) +
  geom_smooth(aes(y = TempSens, x = asrt_lake), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by mean watershed slope and lake cover", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_slope_MEAN"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = asrt_wet, color = Region)) +
  geom_smooth(aes(y = TempSens, x = asrt_wet), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by mean watershed slope and wetland cover", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_slope_MEAN"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = summer_precip, color = Region)) +
  geom_smooth(aes(y = TempSens, x = summer_precip), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by mean watershed slope and summer precipitation", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_slope_MEAN"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = snow_ind, color = Region)) +
  geom_smooth(aes(y = TempSens, x = snow_ind), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by mean watershed slope and snow index", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_north_per"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = snow_ind, color = Region)) +
  geom_smooth(aes(y = TempSens, x = snow_ind), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by watershed north percent and snow index", subtitle = paste0("Facets are bins of ", facet_var))

facet_var <- "wtd_north_per"

mod_dat %>% 
  mutate(fct = cut(get(facet_var), seq(from = min(get(facet_var)) - 0.01, to = max(get(facet_var)), length.out = 5))) %>% 
  ggplot() +
  geom_point(aes(y = TempSens, x = summer_precip, color = Region)) +
  geom_smooth(aes(y = TempSens, x = summer_precip), method = "lm") +
  facet_wrap(~fct) +
  labs(title = "TS by watershed north percent and summer precipitation", subtitle = paste0("Facets are bins of ", facet_var))

3 Reduce covariates

Reduced the list of covariates based on pairwise correlations and VIF. Also transformed covariates that were heavily right skewed. Arcsine square-root for proportions and log10 for continuous. Glacier cover still heavily right-skewed so added a binary presence-absence for glacier cover as well and checked VIF. Final list of covariates, which are also listed with data sources on google drive sheet:

  • stream order
  • stream gradient
  • distance to coast
  • catchment min, max, and mean slope
  • watershed min, max, and mean slope
  • catchment min, max, and mean elevation
  • watershed min, max, and mean elevation
  • watershed percent north aspect
  • watershed percent wetland cover
  • watershed percent glacier cover
  • watershed percent lake cover
  • watershed area
  • watershed LCLD (last day of longest continuous snow season) by year (2001-2019) - converted to a snow index, the residuals of a model predicting LCLD using mean watershed slope2
  • total summer precipitation at site by year

Removed covariates with pairwise correlations r > 0.7 and VIF > 3. Final list of 13 covariates:

  • log stream gradient
  • log mean catchment elevation
  • log mean catchment slope
  • watershed percent north aspect
  • mean watershed slope
  • log watershed area
  • distance to coast
  • arcsine square-root watershed wetland percent
  • arcsine square-root watershed glacier cover
  • arcsine square-root watershed lake cover
  • snow index
  • summer precipitation
  • glacier presence-absence

4 Select random effects

Created a global model with all 13 covariates plus five interactions from Tim’s Bristol Bay paper and results. Selected best random effects.

Interactions:

  • snow x north
  • slope x north
  • north x precip
  • slope x precip
  • slope x snow

Random effects:

  • none
  • random intercept for Site (multiple TS by year for sites)
  • random intercept for Site within HUC8
  • random intercept for Site within Region (this doesn’t make a lot of sense per mixed effects literature since we only have 5 regions – could include as a fixed effect)

Lowest AIC for HUC8/Site. Predictions can be made at level 1 for HUC8, except for the one or two without data, which we can predict using level 0, or population mean for random intercept.

5 Develop model set

Dredged all subsets of global model to determine variable importance: sum of model weights for all models in which a covariate appears.

lme1_dr <- readRDS("output/lme1m_dredge_results.rds")

#variable importance
lme1_dr %>% 
  as_tibble() %>% 
  mutate(across(asrt_glac:'wtd_north_per:wtd_slope_MEAN', ~ case_when(!is.na(.) ~ weight))) %>% 
  select(asrt_glac:'wtd_north_per:wtd_slope_MEAN') %>% 
  colSums(., na.rm = TRUE) %>% 
  enframe() %>% 
  arrange(desc(value)) %>% 
  ggplot(aes(y = fct_reorder(name, value), x = value)) +
  geom_point() +
  theme_bw() +
  labs(x = "Variable Importance Value", y = "Covariates and Interactions")

Model set of 6 models:

  • global model
  • model with top 12 covariates
  • model with top 8 covariates
  • model with top 4 covariates
  • null model
  • random forest model (I randomly selected only 1 year for each site to avoid pseudo-replicating the spatial covariates)

6 Cross validation

Model selection via cross-validation. Constructing appropriate cross-validation groups to select the optimal model depends on our prediction goals. This paper on cross-validation strategies has some interesting ideas and guidance. I tried three different methods: temporal splits by groups of years, spatial splits by sites in the same HUC10, and leave-one-out.

  • Temporal cross-validation groups were constructed by splitting the years into five groups. For temporal cross-validation, predictions were made for the withheld data using the random intercept for HUC8.
  • Spatial cross-validation was done by constructing 21 groups with 6 HUC10 each that were not adjacent. Predictions were made using the population intercept since these groups overlapped with the HUC8 groupings used for the random intercept.
  • Leave-one-out cross validation withholds one site at a time, builds the model, and predicts for the years of data for that site. I removed any sites that were the only site in a HUC8 in order to predict with the HUC8 random intercepts.

For all cross-validations, the predictions on the testing data were saved and used to calculate RMSE, MAE, and observed versus predicted correlations.

The figure shows the mean RMSE +/- 1SE across cross-validation groups. SE for LOO is missing because groups are only a single site so the RMSE was calculated for all predictions and not by group.

xval_results <- read_rds("output/xval_results.rds") 

xval_results %>% 
  # filter(!xval_type == "LOO") %>% 
  mutate(modelf = factor(model, levels = c("global", "lme_12vars", "lme_8vars", "lme_4vars", "lme_null", "rf"),
                         labels = c("global", "12 vars.", "8 vars.", "4 vars.", "null", "RF"))) %>% 
  ggplot(aes(x = modelf, y = rmse, color = xval_type)) +
  stat_summary(fun = "mean", geom = "point", size = 3) +
  stat_summary(fun.data = "mean_se", geom = "errorbar", width = 0.2) +
  labs(y = "RMSE on Validation Data", x = "Model", color = "Cross-validation Type") +
  theme_bw() +
  theme(legend.position = "bottom", text = element_text(size = 16))

Table summarizing average RMSE, MAE, and correlations for observed versus predicted TS by model.

xval_results %>% 
  group_by(model, xval_type) %>% 
  summarize(mean_rmse = mean(rmse), mean_mae = mean(mae), mean_cor = mean(obs_pred)) %>% 
  kable(digits = 2, col.names = c("Model", "Xval Type", "RMSE", "MAE", "Cor. (r)")) %>% 
  kable_styling()
Model Xval Type RMSE MAE Cor. (r)
global LOO 0.11 0.08 0.48
global spatial 0.11 0.09 0.25
global temporal 0.11 0.08 0.53
lme_12vars LOO 0.11 0.08 0.49
lme_12vars spatial 0.11 0.09 0.29
lme_12vars temporal 0.11 0.08 0.54
lme_4vars LOO 0.11 0.08 0.50
lme_4vars spatial 0.11 0.09 0.27
lme_4vars temporal 0.11 0.08 0.53
lme_8vars LOO 0.11 0.08 0.49
lme_8vars spatial 0.11 0.09 0.28
lme_8vars temporal 0.11 0.08 0.53
lme_null LOO 0.11 0.09 0.45
lme_null spatial 0.12 0.10 NA
lme_null temporal 0.11 0.09 0.48
rf LOO 0.11 0.08 0.52
rf spatial 0.11 0.09 0.27
rf temporal 0.09 0.07 0.71

Plots of observed versus predicted TS by the different models using the LOO cross-validation predictions. The RF model was constructed with just one year for each site as before. Pearson correlations between observed and predicted by region indicate that the models do really poorly for the regions with very little data: Copper, PWS, and Kodiak. We could try region specific models, but we would likely need to consider a smaller set of predictors as these regions don’t have a lot of data.

xval_preds <- readRDS("output/xval_preds.rds")

xval_preds %>% 
  filter(xval_type == "LOO") %>% 
  mutate(modelf = factor(model, levels = c("global", "lme_12vars", "lme_8vars", "lme_4vars", "lme_null", "rf"),
                         labels = c("global", "12 vars.", "8 vars.", "4 vars.", "null", "RF"))) %>% 
  ggplot(aes(x = TempSens, y = preds)) +
  geom_point() +
  geom_abline(aes(intercept = 0, slope = 1)) +
  facet_grid(cols = vars(Region), rows = vars(modelf)) +
  coord_cartesian(xlim = c(-0.2, 1), ylim = c(-0.2,1)) +
  stat_cor(label.x.npc = 0, label.y = c(seq(0.6, 1, 0.1)))

7 CART analysis

Using rpart to create a regression tree with all of the data.

ct_all <- rpart(TempSens ~ log_slope + log_cat_elev + log_cat_slope + wtd_north_per +
                      wtd_slope_MEAN + log_area + dist_coast_km + asrt_wet + 
                      asrt_glac + asrt_lake + snow_ind + summer_precip, 
                    data = mod_dat, method = "anova")

Print the cross validation results to select a complexity parameter for tree-pruning. From plotcp: “A good choice of cp for pruning is often the leftmost value for which the mean lies below the horizontal line.” Select cp for 12 splits.

plotcp(ct_all) 

printcp(ct_all) 
## 
## Regression tree:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat, method = "anova")
## 
## Variables actually used in tree construction:
## [1] asrt_lake      asrt_wet       dist_coast_km  log_area       log_cat_elev  
## [6] log_cat_slope  snow_ind       summer_precip  wtd_slope_MEAN
## 
## Root node error: 26.151/1668 = 0.015678
## 
## n= 1668 
## 
##          CP nsplit rel error  xerror     xstd
## 1  0.117823      0   1.00000 1.00094 0.036072
## 2  0.056083      1   0.88218 0.88401 0.036571
## 3  0.050974      2   0.82609 0.84747 0.036623
## 4  0.036374      3   0.77512 0.80536 0.035724
## 5  0.026689      4   0.73875 0.74272 0.032560
## 6  0.025873      5   0.71206 0.73046 0.032044
## 7  0.020373      7   0.66031 0.68410 0.032474
## 8  0.017639      8   0.63994 0.68047 0.031902
## 9  0.016017      9   0.62230 0.67497 0.033042
## 10 0.015695     10   0.60628 0.66995 0.033100
## 11 0.011835     13   0.55920 0.64668 0.032814
## 12 0.011445     14   0.54737 0.60608 0.028162
## 13 0.010847     15   0.53592 0.60320 0.028017
## 14 0.010411     17   0.51423 0.59425 0.028300
## 15 0.010000     19   0.49341 0.59189 0.028323
cp_parm <- 0.011197

Prune the tree and print the results.

ct_pr <- prune(ct_all, cp = cp_parm)

# print(ct_pr)

par(xpd = TRUE)
plot(ct_pr, compress = TRUE)
text(ct_pr, use.n = TRUE)

Summary table indicates variable importance and also lists surrogate splits. Interesting that snow index and precipitation are the least important variables.

summary(ct_pr)
## Call:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat, method = "anova")
##   n= 1668 
## 
##            CP nsplit rel error    xerror       xstd
## 1  0.11782308      0 1.0000000 1.0009384 0.03607166
## 2  0.05608274      1 0.8821769 0.8840114 0.03657144
## 3  0.05097418      2 0.8260942 0.8474722 0.03662257
## 4  0.03637352      3 0.7751200 0.8053602 0.03572362
## 5  0.02668900      4 0.7387465 0.7427187 0.03256005
## 6  0.02587251      5 0.7120575 0.7304598 0.03204429
## 7  0.02037349      7 0.6603125 0.6841004 0.03247387
## 8  0.01763869      8 0.6399390 0.6804750 0.03190181
## 9  0.01601656      9 0.6223003 0.6749690 0.03304154
## 10 0.01569466     10 0.6062837 0.6699510 0.03310048
## 11 0.01183466     13 0.5591997 0.6466760 0.03281356
## 12 0.01144498     14 0.5473651 0.6060833 0.02816225
## 13 0.01119700     15 0.5359201 0.6031987 0.02801685
## 
## Variable importance
## wtd_slope_MEAN  dist_coast_km       asrt_wet   log_cat_elev  log_cat_slope 
##             17             15             14             13              8 
##       log_area      asrt_lake      log_slope      asrt_glac  wtd_north_per 
##              8              7              5              4              4 
##       snow_ind  summer_precip 
##              3              1 
## 
## Node number 1: 1668 observations,    complexity param=0.1178231
##   mean=0.2524974, MSE=0.01567779 
##   left son=2 (879 obs) right son=3 (789 obs)
##   Primary splits:
##       wtd_slope_MEAN < 9.580174    to the right, improve=0.11782310, (0 missing)
##       dist_coast_km  < 83.65199    to the left,  improve=0.08603335, (0 missing)
##       asrt_wet       < 0.279366    to the left,  improve=0.06215807, (0 missing)
##       log_cat_elev   < 1.912884    to the left,  improve=0.05125803, (0 missing)
##       log_cat_slope  < 1.038689    to the right, improve=0.04947506, (0 missing)
##   Surrogate splits:
##       asrt_wet      < 0.1972921   to the left,  agree=0.759, adj=0.490, (0 split)
##       log_cat_slope < 0.7687072   to the right, agree=0.667, adj=0.295, (0 split)
##       asrt_glac     < 0.01209116  to the right, agree=0.665, adj=0.292, (0 split)
##       log_slope     < 2.882267    to the right, agree=0.634, adj=0.226, (0 split)
##       dist_coast_km < 71.27378    to the left,  agree=0.632, adj=0.223, (0 split)
## 
## Node number 2: 879 observations,    complexity param=0.03637352
##   mean=0.211778, MSE=0.01444269 
##   left son=4 (742 obs) right son=5 (137 obs)
##   Primary splits:
##       asrt_wet       < 0.2824055   to the left,  improve=0.07492542, (0 missing)
##       wtd_slope_MEAN < 23.98557    to the right, improve=0.06029834, (0 missing)
##       dist_coast_km  < 24.59904    to the right, improve=0.04299903, (0 missing)
##       log_area       < 2.096369    to the left,  improve=0.03882288, (0 missing)
##       log_cat_elev   < 2.087551    to the left,  improve=0.03693692, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 205.5014    to the left,  agree=0.854, adj=0.066, (0 split)
##       snow_ind      < -27.974     to the right, agree=0.854, adj=0.066, (0 split)
##       wtd_north_per < 47.28605    to the left,  agree=0.853, adj=0.058, (0 split)
##       log_area      < 0.5378175   to the right, agree=0.853, adj=0.058, (0 split)
##       log_cat_elev  < 2.842349    to the left,  agree=0.851, adj=0.044, (0 split)
## 
## Node number 3: 789 observations,    complexity param=0.05608274
##   mean=0.2978616, MSE=0.01314866 
##   left son=6 (500 obs) right son=7 (289 obs)
##   Primary splits:
##       log_cat_elev  < 1.912884    to the left,  improve=0.14136820, (0 missing)
##       dist_coast_km < 64.68648    to the left,  improve=0.10994790, (0 missing)
##       log_area      < 0.9796606   to the left,  improve=0.09749469, (0 missing)
##       summer_precip < 120.46      to the right, improve=0.07405044, (0 missing)
##       asrt_lake     < 0.1675021   to the right, improve=0.06652651, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 77.63445    to the left,  agree=0.897, adj=0.720, (0 split)
##       wtd_north_per < 8.468764    to the right, agree=0.721, adj=0.239, (0 split)
##       asrt_wet      < 0.09142945  to the right, agree=0.702, adj=0.187, (0 split)
##       log_cat_slope < 0.8481061   to the left,  agree=0.677, adj=0.118, (0 split)
##       snow_ind      < 7.627066    to the left,  agree=0.664, adj=0.083, (0 split)
## 
## Node number 4: 742 observations,    complexity param=0.026689
##   mean=0.1976429, MSE=0.0120491 
##   left son=8 (462 obs) right son=9 (280 obs)
##   Primary splits:
##       log_area       < 2.096369    to the left,  improve=0.07806470, (0 missing)
##       log_cat_elev   < 2.096948    to the left,  improve=0.05497419, (0 missing)
##       wtd_slope_MEAN < 27.78673    to the right, improve=0.05310649, (0 missing)
##       dist_coast_km  < 123.1085    to the left,  improve=0.04852862, (0 missing)
##       wtd_north_per  < 7.072823    to the left,  improve=0.02987629, (0 missing)
##   Surrogate splits:
##       asrt_glac     < 0.01156298  to the left,  agree=0.697, adj=0.196, (0 split)
##       log_slope     < 2.289019    to the right, agree=0.683, adj=0.161, (0 split)
##       dist_coast_km < 90.30846    to the left,  agree=0.683, adj=0.161, (0 split)
##       snow_ind      < 12.83373    to the left,  agree=0.678, adj=0.146, (0 split)
##       asrt_wet      < 0.1076148   to the left,  agree=0.658, adj=0.093, (0 split)
## 
## Node number 5: 137 observations,    complexity param=0.02037349
##   mean=0.2883342, MSE=0.02046354 
##   left son=10 (59 obs) right son=11 (78 obs)
##   Primary splits:
##       wtd_slope_MEAN < 13.90976    to the left,  improve=0.1900400, (0 missing)
##       snow_ind       < -2.356232   to the right, improve=0.1894510, (0 missing)
##       log_cat_elev   < 1.149802    to the right, improve=0.1644225, (0 missing)
##       dist_coast_km  < 20.35841    to the right, improve=0.1464481, (0 missing)
##       wtd_north_per  < 10.67759    to the left,  improve=0.1129494, (0 missing)
##   Surrogate splits:
##       asrt_wet      < 0.3845997   to the right, agree=0.839, adj=0.627, (0 split)
##       log_area      < 0.6163236   to the left,  agree=0.774, adj=0.475, (0 split)
##       wtd_north_per < 16.42505    to the left,  agree=0.766, adj=0.458, (0 split)
##       log_cat_elev  < 1.500962    to the left,  agree=0.723, adj=0.356, (0 split)
##       dist_coast_km < 0.1619185   to the left,  agree=0.672, adj=0.237, (0 split)
## 
## Node number 6: 500 observations,    complexity param=0.02587251
##   mean=0.2650838, MSE=0.01112529 
##   left son=12 (137 obs) right son=13 (363 obs)
##   Primary splits:
##       log_area      < 1.723963    to the left,  improve=0.10713680, (0 missing)
##       summer_precip < 97.665      to the right, improve=0.09602527, (0 missing)
##       log_cat_elev  < 1.382246    to the left,  improve=0.09384839, (0 missing)
##       asrt_lake     < 0.05347914  to the right, improve=0.07654909, (0 missing)
##       wtd_north_per < 24.39462    to the left,  improve=0.07173712, (0 missing)
##   Surrogate splits:
##       summer_precip < 495.115     to the right, agree=0.798, adj=0.263, (0 split)
##       log_cat_elev  < 1.328695    to the left,  agree=0.792, adj=0.241, (0 split)
##       log_slope     < 2.883745    to the right, agree=0.786, adj=0.219, (0 split)
##       dist_coast_km < 0.571042    to the left,  agree=0.784, adj=0.212, (0 split)
##       snow_ind      < 14.07349    to the right, agree=0.772, adj=0.168, (0 split)
## 
## Node number 7: 289 observations,    complexity param=0.05097418
##   mean=0.3545707, MSE=0.01157457 
##   left son=14 (33 obs) right son=15 (256 obs)
##   Primary splits:
##       log_cat_elev   < 2.560219    to the right, improve=0.3985000, (0 missing)
##       dist_coast_km  < 133.6306    to the right, improve=0.3935184, (0 missing)
##       wtd_slope_MEAN < 1.027043    to the left,  improve=0.1806864, (0 missing)
##       log_cat_slope  < -0.03784077 to the left,  improve=0.1146985, (0 missing)
##       asrt_lake      < 0.001917876 to the left,  improve=0.1065575, (0 missing)
##   Surrogate splits:
##       dist_coast_km  < 106.8269    to the right, agree=0.983, adj=0.848, (0 split)
##       wtd_slope_MEAN < 1.027043    to the left,  agree=0.920, adj=0.303, (0 split)
##       log_cat_slope  < 1.031943    to the right, agree=0.903, adj=0.152, (0 split)
##       asrt_wet       < 0.007257437 to the left,  agree=0.903, adj=0.152, (0 split)
##       log_area       < 3.541905    to the right, agree=0.896, adj=0.091, (0 split)
## 
## Node number 8: 462 observations,    complexity param=0.01569466
##   mean=0.1737669, MSE=0.01078022 
##   left son=16 (52 obs) right son=17 (410 obs)
##   Primary splits:
##       wtd_slope_MEAN < 27.78673    to the right, improve=0.05483327, (0 missing)
##       dist_coast_km  < 19.90627    to the right, improve=0.05204310, (0 missing)
##       summer_precip  < 346.325     to the left,  improve=0.04227761, (0 missing)
##       asrt_wet       < 0.02572079  to the left,  improve=0.04123931, (0 missing)
##       asrt_glac      < 0.254831    to the right, improve=0.03361265, (0 missing)
##   Surrogate splits:
##       log_cat_slope < 1.289088    to the right, agree=0.911, adj=0.212, (0 split)
##       dist_coast_km < 0.2634053   to the left,  agree=0.903, adj=0.135, (0 split)
##       asrt_lake     < 0.3365521   to the right, agree=0.894, adj=0.058, (0 split)
## 
## Node number 9: 280 observations,    complexity param=0.01601656
##   mean=0.2370384, MSE=0.01165014 
##   left son=18 (66 obs) right son=19 (214 obs)
##   Primary splits:
##       log_cat_slope < 0.4658453   to the left,  improve=0.1283988, (0 missing)
##       asrt_lake     < 0.145426    to the right, improve=0.1233636, (0 missing)
##       log_cat_elev  < 2.10936     to the left,  improve=0.1186668, (0 missing)
##       asrt_glac     < 0.2219403   to the right, improve=0.1172669, (0 missing)
##       log_slope     < 2.601229    to the left,  improve=0.1083309, (0 missing)
##   Surrogate splits:
##       log_area     < 3.882179    to the right, agree=0.839, adj=0.318, (0 split)
##       log_cat_elev < 1.486185    to the left,  agree=0.789, adj=0.106, (0 split)
##       asrt_glac    < 0.5472557   to the right, agree=0.789, adj=0.106, (0 split)
##       asrt_lake    < 0.01812404  to the left,  agree=0.779, adj=0.061, (0 split)
##       asrt_wet     < 0.1379552   to the right, agree=0.775, adj=0.045, (0 split)
## 
## Node number 10: 59 observations,    complexity param=0.01763869
##   mean=0.2166317, MSE=0.01555308 
##   left son=20 (43 obs) right son=21 (16 obs)
##   Primary splits:
##       asrt_lake      < 0.25946     to the left,  improve=0.5026653, (0 missing)
##       wtd_north_per  < 14.58423    to the left,  improve=0.3189109, (0 missing)
##       summer_precip  < 449.855     to the left,  improve=0.3016230, (0 missing)
##       dist_coast_km  < 13.10007    to the right, improve=0.2904042, (0 missing)
##       wtd_slope_MEAN < 10.74938    to the right, improve=0.2900983, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 10.74938    to the right, agree=0.898, adj=0.625, (0 split)
##       log_slope      < 0.9154418   to the right, agree=0.864, adj=0.500, (0 split)
##       log_area       < 0.3408574   to the right, agree=0.864, adj=0.500, (0 split)
##       asrt_wet       < 0.3626343   to the right, agree=0.847, adj=0.438, (0 split)
##       wtd_north_per  < 14.58423    to the left,  agree=0.797, adj=0.250, (0 split)
## 
## Node number 11: 78 observations,    complexity param=0.01183466
##   mean=0.3425707, MSE=0.01734737 
##   left son=22 (15 obs) right son=23 (63 obs)
##   Primary splits:
##       snow_ind      < 10.28793    to the right, improve=0.2287222, (0 missing)
##       asrt_wet      < 0.376018    to the left,  improve=0.2109144, (0 missing)
##       log_area      < 0.8209101   to the right, improve=0.1798855, (0 missing)
##       log_cat_elev  < 1.18285     to the right, improve=0.1798855, (0 missing)
##       dist_coast_km < 5.586949    to the right, improve=0.1627627, (0 missing)
##   Surrogate splits:
##       wtd_north_per < 35.90707    to the right, agree=0.859, adj=0.267, (0 split)
##       log_area      < 3.490255    to the right, agree=0.833, adj=0.133, (0 split)
##       asrt_glac     < 0.2351146   to the right, agree=0.833, adj=0.133, (0 split)
## 
## Node number 12: 137 observations
##   mean=0.2088862, MSE=0.008942191 
## 
## Node number 13: 363 observations,    complexity param=0.02587251
##   mean=0.2862934, MSE=0.01030744 
##   left son=26 (276 obs) right son=27 (87 obs)
##   Primary splits:
##       dist_coast_km < 1.44316     to the right, improve=0.20237260, (0 missing)
##       log_cat_slope < 0.6440247   to the left,  improve=0.15974730, (0 missing)
##       asrt_lake     < 0.05670925  to the right, improve=0.13122180, (0 missing)
##       summer_precip < 97.665      to the right, improve=0.09970441, (0 missing)
##       wtd_north_per < 24.49116    to the left,  improve=0.07031372, (0 missing)
##   Surrogate splits:
##       asrt_lake     < 0.04391394  to the right, agree=0.917, adj=0.655, (0 split)
##       log_cat_slope < 0.6440247   to the left,  agree=0.895, adj=0.563, (0 split)
##       log_slope     < 2.763205    to the left,  agree=0.813, adj=0.218, (0 split)
##       summer_precip < 70.76       to the right, agree=0.796, adj=0.149, (0 split)
##       wtd_north_per < 30.37812    to the left,  agree=0.788, adj=0.115, (0 split)
## 
## Node number 14: 33 observations
##   mean=0.1654106, MSE=0.005788662 
## 
## Node number 15: 256 observations
##   mean=0.3789547, MSE=0.007113369 
## 
## Node number 16: 52 observations
##   mean=0.1054975, MSE=0.004654534 
## 
## Node number 17: 410 observations,    complexity param=0.01569466
##   mean=0.1824254, MSE=0.01089105 
##   left son=34 (72 obs) right son=35 (338 obs)
##   Primary splits:
##       asrt_wet      < 0.01850234  to the left,  improve=0.06336545, (0 missing)
##       summer_precip < 346.325     to the left,  improve=0.05877741, (0 missing)
##       dist_coast_km < 19.90627    to the right, improve=0.05737050, (0 missing)
##       log_area      < 1.332456    to the left,  improve=0.04675155, (0 missing)
##       log_cat_elev  < 1.843271    to the left,  improve=0.04605001, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 10.92582    to the left,  agree=0.878, adj=0.306, (0 split)
##       wtd_north_per  < 2.441448    to the left,  agree=0.844, adj=0.111, (0 split)
##       log_area       < 0.3840851   to the left,  agree=0.844, adj=0.111, (0 split)
##       asrt_glac      < 0.8691906   to the right, agree=0.834, adj=0.056, (0 split)
##       snow_ind       < 63.95317    to the right, agree=0.834, adj=0.056, (0 split)
## 
## Node number 18: 66 observations
##   mean=0.1673949, MSE=0.01090623 
## 
## Node number 19: 214 observations
##   mean=0.2585173, MSE=0.009922364 
## 
## Node number 20: 43 observations
##   mean=0.1626964, MSE=0.004643366 
## 
## Node number 21: 16 observations
##   mean=0.3615829, MSE=0.01604409 
## 
## Node number 22: 15 observations
##   mean=0.2134797, MSE=0.00267514 
## 
## Node number 23: 63 observations
##   mean=0.3733066, MSE=0.01592834 
## 
## Node number 26: 276 observations,    complexity param=0.01144498
##   mean=0.2606511, MSE=0.008576905 
##   left son=52 (41 obs) right son=53 (235 obs)
##   Primary splits:
##       log_cat_elev  < 1.386769    to the left,  improve=0.12643180, (0 missing)
##       asrt_lake     < 0.1657009   to the right, improve=0.12421390, (0 missing)
##       summer_precip < 100.16      to the right, improve=0.08968576, (0 missing)
##       dist_coast_km < 41.47178    to the left,  improve=0.07918064, (0 missing)
##       log_area      < 3.352934    to the right, improve=0.05877336, (0 missing)
##   Surrogate splits:
##       asrt_lake < 0.3193176   to the right, agree=0.909, adj=0.390, (0 split)
##       log_area  < 3.485453    to the right, agree=0.862, adj=0.073, (0 split)
##       asrt_glac < 0.0481324   to the right, agree=0.862, adj=0.073, (0 split)
## 
## Node number 27: 87 observations
##   mean=0.3676412, MSE=0.007093985 
## 
## Node number 34: 72 observations,    complexity param=0.01569466
##   mean=0.125507, MSE=0.01311781 
##   left son=68 (65 obs) right son=69 (7 obs)
##   Primary splits:
##       asrt_lake     < 0.03335696  to the right, improve=0.7149205, (0 missing)
##       dist_coast_km < 77.73727    to the left,  improve=0.2927426, (0 missing)
##       log_cat_elev  < 2.389058    to the left,  improve=0.2816950, (0 missing)
##       log_cat_slope < 0.8089726   to the left,  improve=0.2430115, (0 missing)
##       log_area      < 1.318701    to the left,  improve=0.1370812, (0 missing)
## 
## Node number 35: 338 observations
##   mean=0.1945501, MSE=0.009579591 
## 
## Node number 52: 41 observations
##   mean=0.1818131, MSE=0.009323335 
## 
## Node number 53: 235 observations
##   mean=0.2744058, MSE=0.007173091 
## 
## Node number 68: 65 observations
##   mean=0.0937271, MSE=0.004010371 
## 
## Node number 69: 7 observations
##   mean=0.4206056, MSE=0.001225491

7.1 Cook Inlet Regression Tree

ct_ci <- rpart(TempSens ~ log_slope + log_cat_elev + log_cat_slope + wtd_north_per +
                      wtd_slope_MEAN + log_area + dist_coast_km + asrt_wet + 
                      asrt_glac + asrt_lake + snow_ind + summer_precip, 
                    data = mod_dat %>% filter(Region == "Cook_Inlet"), method = "anova")
# plotcp(ct_ci) 
# printcp(ct_ci) 
cp_parm <- 0.010000
ct_cipr <- prune(ct_ci, cp = cp_parm)

par(xpd = TRUE)
plot(ct_cipr, compress = TRUE)
text(ct_cipr, use.n = TRUE)

Summary table indicates variable importance and also lists surrogate splits. Interesting that snow index and precipitation are the least important variables.

summary(ct_cipr)
## Call:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Cook_Inlet"), method = "anova")
##   n= 695 
## 
##            CP nsplit rel error    xerror       xstd
## 1  0.16380760      0 1.0000000 1.0012790 0.04901906
## 2  0.07809174      1 0.8361924 0.9174194 0.04736184
## 3  0.07227784      2 0.7581007 0.8316640 0.04518892
## 4  0.04490585      3 0.6858228 0.7003407 0.03770939
## 5  0.04132557      5 0.5960111 0.6912637 0.03755904
## 6  0.03246605      7 0.5133600 0.6355802 0.03494417
## 7  0.02223091      8 0.4808939 0.5909887 0.03467088
## 8  0.02051001      9 0.4586630 0.5673747 0.03299279
## 9  0.01758050     10 0.4381530 0.5450396 0.03256031
## 10 0.01313623     11 0.4205725 0.5250902 0.03171056
## 11 0.01071056     12 0.4074363 0.4965243 0.02989084
## 12 0.01000000     13 0.3967257 0.4688192 0.02900346
## 
## Variable importance
##      asrt_lake   log_cat_elev wtd_slope_MEAN       asrt_wet      log_slope 
##             13             12             11             11              9 
##  log_cat_slope  dist_coast_km      asrt_glac  wtd_north_per  summer_precip 
##              9              9              8              8              4 
##       log_area       snow_ind 
##              4              2 
## 
## Node number 1: 695 observations,    complexity param=0.1638076
##   mean=0.2857732, MSE=0.01151821 
##   left son=2 (176 obs) right son=3 (519 obs)
##   Primary splits:
##       asrt_lake      < 0.1543653  to the right, improve=0.1638076, (0 missing)
##       wtd_slope_MEAN < 12.1582    to the right, improve=0.1488056, (0 missing)
##       asrt_glac      < 0.02317135 to the right, improve=0.1442814, (0 missing)
##       dist_coast_km  < 81.94809   to the left,  improve=0.1345888, (0 missing)
##       asrt_wet       < 0.27811    to the left,  improve=0.1238370, (0 missing)
##   Surrogate splits:
##       log_cat_elev   < 1.430724   to the left,  agree=0.799, adj=0.205, (0 split)
##       log_cat_slope  < 1.160958   to the right, agree=0.771, adj=0.097, (0 split)
##       log_slope      < 3.404853   to the right, agree=0.764, adj=0.068, (0 split)
##       asrt_wet       < 0.8753526  to the right, agree=0.760, adj=0.051, (0 split)
##       wtd_slope_MEAN < 1.510491   to the left,  agree=0.757, adj=0.040, (0 split)
## 
## Node number 2: 176 observations,    complexity param=0.07227784
##   mean=0.2111821, MSE=0.01173036 
##   left son=4 (73 obs) right son=5 (103 obs)
##   Primary splits:
##       wtd_slope_MEAN < 9.13332    to the right, improve=0.2802536, (0 missing)
##       wtd_north_per  < 21.23727   to the right, improve=0.2219542, (0 missing)
##       asrt_wet       < 0.06127814 to the left,  improve=0.2064854, (0 missing)
##       dist_coast_km  < 0.7553228  to the right, improve=0.2041683, (0 missing)
##       asrt_glac      < 0.02313816 to the right, improve=0.1776553, (0 missing)
##   Surrogate splits:
##       asrt_glac     < 0.02313816 to the right, agree=0.949, adj=0.877, (0 split)
##       asrt_wet      < 0.1418393  to the left,  agree=0.920, adj=0.808, (0 split)
##       wtd_north_per < 22.31088   to the right, agree=0.898, adj=0.753, (0 split)
##       log_cat_slope < 0.686579   to the right, agree=0.858, adj=0.658, (0 split)
##       log_cat_elev  < 2.208882   to the right, agree=0.801, adj=0.521, (0 split)
## 
## Node number 3: 519 observations,    complexity param=0.07809174
##   mean=0.311068, MSE=0.008919669 
##   left son=6 (223 obs) right son=7 (296 obs)
##   Primary splits:
##       asrt_wet       < 0.27811    to the left,  improve=0.13503890, (0 missing)
##       wtd_slope_MEAN < 12.1582    to the right, improve=0.12138270, (0 missing)
##       dist_coast_km  < 81.94809   to the left,  improve=0.12102950, (0 missing)
##       asrt_glac      < 0.02317135 to the right, improve=0.10175900, (0 missing)
##       log_cat_elev   < 1.511476   to the left,  improve=0.09200909, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 6.897551   to the right, agree=0.929, adj=0.834, (0 split)
##       asrt_glac      < 0.01156298 to the right, agree=0.765, adj=0.453, (0 split)
##       wtd_north_per  < 20.79837   to the right, agree=0.715, adj=0.336, (0 split)
##       log_slope      < 2.835841   to the right, agree=0.701, adj=0.305, (0 split)
##       log_cat_slope  < 0.7687072  to the right, agree=0.686, adj=0.269, (0 split)
## 
## Node number 4: 73 observations,    complexity param=0.02051001
##   mean=0.1430756, MSE=0.006037046 
##   left son=8 (9 obs) right son=9 (64 obs)
##   Primary splits:
##       wtd_slope_MEAN < 25.28172   to the right, improve=0.3725532, (0 missing)
##       log_area       < 1.973891   to the left,  improve=0.3251617, (0 missing)
##       asrt_wet       < 0.06127814 to the left,  improve=0.3005748, (0 missing)
##       asrt_lake      < 0.1937411  to the left,  improve=0.1730297, (0 missing)
##       log_cat_slope  < 1.297077   to the right, improve=0.1546882, (0 missing)
##   Surrogate splits:
##       wtd_north_per < 25.45124   to the right, agree=0.904, adj=0.222, (0 split)
##       asrt_wet      < 0.05165607 to the left,  agree=0.904, adj=0.222, (0 split)
##       snow_ind      < -23.13812  to the left,  agree=0.904, adj=0.222, (0 split)
##       log_cat_elev  < 2.619982   to the right, agree=0.890, adj=0.111, (0 split)
##       log_area      < 1.467194   to the left,  agree=0.890, adj=0.111, (0 split)
## 
## Node number 5: 103 observations,    complexity param=0.03246605
##   mean=0.2594517, MSE=0.01014799 
##   left son=10 (77 obs) right son=11 (26 obs)
##   Primary splits:
##       log_slope     < 2.778153   to the left,  improve=0.2486464, (0 missing)
##       dist_coast_km < 0.7553228  to the right, improve=0.2109303, (0 missing)
##       wtd_north_per < 17.42582   to the right, improve=0.1663214, (0 missing)
##       log_cat_elev  < 1.382246   to the left,  improve=0.1635264, (0 missing)
##       log_cat_slope < 0.63394    to the left,  improve=0.1560394, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 0.7553228  to the right, agree=0.893, adj=0.577, (0 split)
##       asrt_wet      < 0.9347464  to the left,  agree=0.806, adj=0.231, (0 split)
##       log_cat_slope < 0.9338888  to the left,  agree=0.786, adj=0.154, (0 split)
##       log_cat_elev  < 2.318761   to the left,  agree=0.777, adj=0.115, (0 split)
##       wtd_north_per < 5.252984   to the right, agree=0.777, adj=0.115, (0 split)
## 
## Node number 6: 223 observations,    complexity param=0.04132557
##   mean=0.271083, MSE=0.008153274 
##   left son=12 (36 obs) right son=13 (187 obs)
##   Primary splits:
##       dist_coast_km  < 2.442153   to the left,  improve=0.1602131, (0 missing)
##       log_slope      < 2.71324    to the left,  improve=0.1351613, (0 missing)
##       log_area       < 1.953364   to the left,  improve=0.1348240, (0 missing)
##       asrt_lake      < 0.05894178 to the right, improve=0.1128122, (0 missing)
##       wtd_slope_MEAN < 7.203148   to the left,  improve=0.1077528, (0 missing)
##   Surrogate splits:
##       log_cat_elev   < 1.390309   to the left,  agree=0.852, adj=0.083, (0 split)
##       wtd_slope_MEAN < 7.203148   to the left,  agree=0.843, adj=0.028, (0 split)
## 
## Node number 7: 296 observations,    complexity param=0.04490585
##   mean=0.3411919, MSE=0.007385107 
##   left son=14 (205 obs) right son=15 (91 obs)
##   Primary splits:
##       log_cat_elev  < 2.036007   to the left,  improve=0.1525298, (0 missing)
##       dist_coast_km < 92.93437   to the left,  improve=0.1444982, (0 missing)
##       summer_precip < 118.9      to the right, improve=0.1365549, (0 missing)
##       log_cat_slope < 0.7644922  to the left,  improve=0.1083015, (0 missing)
##       log_area      < 2.767006   to the right, improve=0.1020544, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 90.99929   to the left,  agree=0.953, adj=0.846, (0 split)
##       snow_ind      < 10.37911   to the left,  agree=0.784, adj=0.297, (0 split)
##       log_area      < 2.3672     to the right, agree=0.777, adj=0.275, (0 split)
##       summer_precip < 329.595    to the left,  agree=0.774, adj=0.264, (0 split)
##       log_cat_slope < 0.7758349  to the left,  agree=0.770, adj=0.253, (0 split)
## 
## Node number 8: 9 observations
##   mean=0.01660923, MSE=0.001818058 
## 
## Node number 9: 64 observations
##   mean=0.16086, MSE=0.004064938 
## 
## Node number 10: 77 observations,    complexity param=0.02223091
##   mean=0.2302625, MSE=0.007074295 
##   left son=20 (60 obs) right son=21 (17 obs)
##   Primary splits:
##       log_cat_elev   < 1.849241   to the left,  improve=0.3267030, (0 missing)
##       dist_coast_km  < 25.27717   to the left,  improve=0.2940453, (0 missing)
##       log_slope      < 1.395045   to the right, improve=0.2613700, (0 missing)
##       wtd_slope_MEAN < 3.240456   to the right, improve=0.1880452, (0 missing)
##       log_area       < 1.958066   to the right, improve=0.1854073, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 25.27717   to the left,  agree=0.961, adj=0.824, (0 split)
##       log_cat_slope < 0.63394    to the left,  agree=0.883, adj=0.471, (0 split)
##       wtd_north_per < 9.9087     to the right, agree=0.870, adj=0.412, (0 split)
##       log_area      < 1.580039   to the right, agree=0.870, adj=0.412, (0 split)
##       log_slope     < 1.098914   to the right, agree=0.857, adj=0.353, (0 split)
## 
## Node number 11: 26 observations
##   mean=0.3458967, MSE=0.009254853 
## 
## Node number 12: 36 observations
##   mean=0.1887101, MSE=0.003164294 
## 
## Node number 13: 187 observations,    complexity param=0.04132557
##   mean=0.2869409, MSE=0.007555985 
##   left son=26 (82 obs) right son=27 (105 obs)
##   Primary splits:
##       log_slope      < 2.543582   to the left,  improve=0.26209980, (0 missing)
##       log_area       < 1.595786   to the left,  improve=0.12966880, (0 missing)
##       asrt_glac      < 0.06134387 to the right, improve=0.12439560, (0 missing)
##       asrt_lake      < 0.05894178 to the right, improve=0.10422890, (0 missing)
##       wtd_slope_MEAN < 6.743887   to the left,  improve=0.07418931, (0 missing)
##   Surrogate splits:
##       asrt_glac     < 0.06134387 to the right, agree=0.791, adj=0.524, (0 split)
##       log_area      < 2.634679   to the right, agree=0.759, adj=0.451, (0 split)
##       asrt_lake     < 0.05715789 to the right, agree=0.684, adj=0.280, (0 split)
##       log_cat_elev  < 1.606991   to the left,  agree=0.674, adj=0.256, (0 split)
##       log_cat_slope < 0.4733285  to the left,  agree=0.663, adj=0.232, (0 split)
## 
## Node number 14: 205 observations,    complexity param=0.04490585
##   mean=0.3188304, MSE=0.007396603 
##   left son=28 (94 obs) right son=29 (111 obs)
##   Primary splits:
##       summer_precip < 154.385    to the right, improve=0.25425510, (0 missing)
##       asrt_lake     < 0.03634824 to the right, improve=0.19155540, (0 missing)
##       dist_coast_km < 4.665149   to the right, improve=0.16212780, (0 missing)
##       log_cat_elev  < 1.507354   to the left,  improve=0.13659870, (0 missing)
##       log_cat_slope < 0.6404961  to the left,  improve=0.09058894, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 11.02369   to the right, agree=0.780, adj=0.521, (0 split)
##       asrt_lake     < 0.04391394 to the right, agree=0.766, adj=0.489, (0 split)
##       wtd_north_per < 23.49702   to the left,  agree=0.746, adj=0.447, (0 split)
##       log_slope     < 2.332376   to the left,  agree=0.722, adj=0.394, (0 split)
##       log_cat_slope < 0.6160728  to the left,  agree=0.712, adj=0.372, (0 split)
## 
## Node number 15: 91 observations,    complexity param=0.01313623
##   mean=0.3915665, MSE=0.003695157 
##   left son=30 (60 obs) right son=31 (31 obs)
##   Primary splits:
##       snow_ind      < 12.51824   to the left,  improve=0.3127276, (0 missing)
##       asrt_lake     < 0.08027622 to the left,  improve=0.2145961, (0 missing)
##       log_area      < 1.341975   to the left,  improve=0.2066331, (0 missing)
##       log_slope     < 2.8963     to the right, improve=0.1998829, (0 missing)
##       wtd_north_per < 15.59418   to the left,  improve=0.1773300, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 100.0848   to the left,  agree=0.780, adj=0.355, (0 split)
##       summer_precip < 367.09     to the left,  agree=0.780, adj=0.355, (0 split)
##       log_cat_elev  < 2.287008   to the left,  agree=0.747, adj=0.258, (0 split)
##       wtd_north_per < 15.723     to the left,  agree=0.736, adj=0.226, (0 split)
##       log_cat_slope < 0.7194743  to the left,  agree=0.714, adj=0.161, (0 split)
## 
## Node number 20: 60 observations
##   mean=0.2046727, MSE=0.004597441 
## 
## Node number 21: 17 observations
##   mean=0.3205795, MSE=0.005347785 
## 
## Node number 26: 82 observations
##   mean=0.2365831, MSE=0.005298864 
## 
## Node number 27: 105 observations
##   mean=0.3262679, MSE=0.005791652 
## 
## Node number 28: 94 observations,    complexity param=0.01071056
##   mean=0.2717058, MSE=0.004754428 
##   left son=56 (26 obs) right son=57 (68 obs)
##   Primary splits:
##       log_area       < 2.692883   to the right, improve=0.1918473, (0 missing)
##       asrt_lake      < 0.1292506  to the right, improve=0.1434849, (0 missing)
##       log_cat_elev   < 1.514504   to the left,  improve=0.1332888, (0 missing)
##       wtd_slope_MEAN < 2.651101   to the left,  improve=0.1293633, (0 missing)
##       snow_ind       < 5.345323   to the left,  improve=0.1194263, (0 missing)
##   Surrogate splits:
##       asrt_wet       < 0.6551584  to the right, agree=0.862, adj=0.500, (0 split)
##       asrt_lake      < 0.1211275  to the right, agree=0.862, adj=0.500, (0 split)
##       log_slope      < 1.595166   to the left,  agree=0.830, adj=0.385, (0 split)
##       log_cat_elev   < 1.604526   to the left,  agree=0.809, adj=0.308, (0 split)
##       wtd_slope_MEAN < 2.651101   to the left,  agree=0.766, adj=0.154, (0 split)
## 
## Node number 29: 111 observations,    complexity param=0.0175805
##   mean=0.3587378, MSE=0.006160896 
##   left son=58 (11 obs) right son=59 (100 obs)
##   Primary splits:
##       log_cat_elev   < 1.48128    to the left,  improve=0.20579470, (0 missing)
##       log_area       < 2.551222   to the left,  improve=0.11116400, (0 missing)
##       asrt_lake      < 0.03634824 to the right, improve=0.08972545, (0 missing)
##       wtd_slope_MEAN < 6.383506   to the right, improve=0.08044146, (0 missing)
##       asrt_wet       < 0.6109497  to the left,  improve=0.06388513, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 15.23326   to the right, agree=0.919, adj=0.182, (0 split)
##       asrt_glac      < 0.04550073 to the right, agree=0.919, adj=0.182, (0 split)
##       asrt_lake      < 0.1436498  to the right, agree=0.910, adj=0.091, (0 split)
## 
## Node number 30: 60 observations
##   mean=0.3671319, MSE=0.002790595 
## 
## Node number 31: 31 observations
##   mean=0.4388592, MSE=0.002053741 
## 
## Node number 56: 26 observations
##   mean=0.2228636, MSE=0.003864899 
## 
## Node number 57: 68 observations
##   mean=0.2903807, MSE=0.003833664 
## 
## Node number 58: 11 observations
##   mean=0.2513778, MSE=0.004558127 
## 
## Node number 59: 100 observations
##   mean=0.3705475, MSE=0.004929854

7.2 Bristol Bay Regression Tree

ct_bb <- rpart(TempSens ~ log_slope + log_cat_elev + log_cat_slope + wtd_north_per +
                      wtd_slope_MEAN + log_area + dist_coast_km + asrt_wet + 
                      asrt_glac + asrt_lake + snow_ind + summer_precip, 
                    data = mod_dat %>% filter(Region == "Bristol_Bay"), method = "anova")

# plotcp(ct_bb) 
# printcp(ct_bb) 
cp_parm <- 0.014908     
ct_bbpr <- prune(ct_bb, cp = cp_parm)

par(xpd = TRUE)
plot(ct_bbpr, compress = TRUE)
text(ct_bbpr, use.n = TRUE)

Summary table indicates variable importance and also lists surrogate splits. Interesting that snow index and precipitation are the least important variables.

summary(ct_bbpr)
## Call:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Bristol_Bay"), method = "anova")
##   n= 621 
## 
##            CP nsplit rel error    xerror       xstd
## 1  0.25953044      0 1.0000000 1.0036873 0.06189718
## 2  0.12987564      1 0.7404696 0.7451684 0.05418671
## 3  0.03959423      2 0.6105939 0.6152950 0.04905075
## 4  0.03298561      5 0.4918112 0.5750171 0.04461657
## 5  0.03137604      6 0.4588256 0.5364102 0.04335036
## 6  0.02267671      7 0.4274496 0.4611868 0.03887930
## 7  0.02043613      8 0.4047729 0.4680740 0.03904452
## 8  0.02031043      9 0.3843367 0.4597841 0.03852127
## 9  0.01585383     10 0.3640263 0.4393585 0.03389003
## 10 0.01560501     11 0.3481725 0.4265924 0.03359842
## 11 0.01490800     12 0.3325675 0.4203025 0.03342107
## 
## Variable importance
## wtd_slope_MEAN  dist_coast_km   log_cat_elev  log_cat_slope       asrt_wet 
##             19             16             15             13             10 
##      log_slope  wtd_north_per       log_area      asrt_lake       snow_ind 
##              6              6              5              5              3 
##  summer_precip      asrt_glac 
##              2              1 
## 
## Node number 1: 621 observations,    complexity param=0.2595304
##   mean=0.2275389, MSE=0.01687178 
##   left son=2 (354 obs) right son=3 (267 obs)
##   Primary splits:
##       wtd_slope_MEAN < 9.580174   to the right, improve=0.25953040, (0 missing)
##       dist_coast_km  < 89.79      to the left,  improve=0.17135100, (0 missing)
##       log_cat_elev   < 1.922195   to the left,  improve=0.14183210, (0 missing)
##       log_area       < 1.059222   to the left,  improve=0.07948351, (0 missing)
##       log_cat_slope  < 0.1757259  to the right, improve=0.06306649, (0 missing)
##   Surrogate splits:
##       log_cat_slope < 0.3241142  to the right, agree=0.728, adj=0.367, (0 split)
##       dist_coast_km < 75.46811   to the left,  agree=0.665, adj=0.221, (0 split)
##       asrt_wet      < 0.1972921  to the left,  agree=0.659, adj=0.206, (0 split)
##       asrt_lake     < 0.09390993 to the left,  agree=0.643, adj=0.169, (0 split)
##       snow_ind      < -16.52386  to the right, agree=0.628, adj=0.135, (0 split)
## 
## Node number 2: 354 observations,    complexity param=0.03959423
##   mean=0.1700706, MSE=0.01043073 
##   left son=4 (331 obs) right son=5 (23 obs)
##   Primary splits:
##       log_cat_elev   < 2.412037   to the left,  improve=0.10567000, (0 missing)
##       wtd_slope_MEAN < 23.75303   to the right, improve=0.08761686, (0 missing)
##       log_area       < 1.870553   to the left,  improve=0.08306411, (0 missing)
##       wtd_north_per  < 13.70864   to the left,  improve=0.08046964, (0 missing)
##       snow_ind       < 16.34571   to the left,  improve=0.05467892, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 100.3321   to the left,  agree=0.960, adj=0.391, (0 split)
##       summer_precip < 333.405    to the left,  agree=0.952, adj=0.261, (0 split)
## 
## Node number 3: 267 observations,    complexity param=0.1298756
##   mean=0.3037329, MSE=0.01522734 
##   left son=6 (171 obs) right son=7 (96 obs)
##   Primary splits:
##       log_cat_elev  < 1.922195   to the left,  improve=0.3346918, (0 missing)
##       dist_coast_km < 89.79      to the left,  improve=0.2604626, (0 missing)
##       asrt_wet      < 0.1877954  to the right, improve=0.2204019, (0 missing)
##       asrt_lake     < 0.2559445  to the right, improve=0.1417611, (0 missing)
##       log_slope     < 2.69247    to the left,  improve=0.1242257, (0 missing)
##   Surrogate splits:
##       dist_coast_km < 89.79      to the left,  agree=0.858, adj=0.604, (0 split)
##       asrt_wet      < 0.09142945 to the right, agree=0.843, adj=0.562, (0 split)
##       log_slope     < 2.69247    to the left,  agree=0.813, adj=0.479, (0 split)
##       log_cat_slope < 0.5807045  to the left,  agree=0.801, adj=0.448, (0 split)
##       summer_precip < 258.625    to the left,  agree=0.682, adj=0.115, (0 split)
## 
## Node number 4: 331 observations,    complexity param=0.03959423
##   mean=0.1613191, MSE=0.009348249 
##   left son=8 (119 obs) right son=9 (212 obs)
##   Primary splits:
##       dist_coast_km < 63.30797   to the right, improve=0.1325963, (0 missing)
##       log_area      < 1.870553   to the left,  improve=0.1310345, (0 missing)
##       asrt_wet      < 0.01692271 to the left,  improve=0.1167827, (0 missing)
##       log_cat_slope < 0.7423384  to the right, improve=0.1063350, (0 missing)
##       asrt_lake     < 0.2564517  to the left,  improve=0.0842111, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 20.84414   to the right, agree=0.798, adj=0.437, (0 split)
##       log_cat_elev   < 1.889437   to the right, agree=0.764, adj=0.345, (0 split)
##       wtd_north_per  < 13.0474    to the left,  agree=0.752, adj=0.311, (0 split)
##       log_cat_slope  < 1.052894   to the right, agree=0.701, adj=0.168, (0 split)
##       log_area       < 3.469969   to the right, agree=0.698, adj=0.160, (0 split)
## 
## Node number 5: 23 observations
##   mean=0.2960163, MSE=0.00904458 
## 
## Node number 6: 171 observations,    complexity param=0.03298561
##   mean=0.250243, MSE=0.01035615 
##   left son=12 (161 obs) right son=13 (10 obs)
##   Primary splits:
##       dist_coast_km < 1.216125   to the right, improve=0.19515640, (0 missing)
##       asrt_lake     < 0.1777405  to the right, improve=0.12313760, (0 missing)
##       asrt_wet      < 0.1877954  to the right, improve=0.11649020, (0 missing)
##       log_slope     < 1.883781   to the right, improve=0.07677703, (0 missing)
##       log_area      < 0.9034425  to the left,  improve=0.07298328, (0 missing)
## 
## Node number 7: 96 observations,    complexity param=0.03137604
##   mean=0.3990118, MSE=0.009729601 
##   left son=14 (30 obs) right son=15 (66 obs)
##   Primary splits:
##       log_cat_slope  < 0.7224346  to the right, improve=0.3519529, (0 missing)
##       asrt_lake      < 0.1427585  to the left,  improve=0.2463597, (0 missing)
##       log_area       < 1.410855   to the right, improve=0.1962206, (0 missing)
##       wtd_slope_MEAN < 2.920316   to the right, improve=0.1751747, (0 missing)
##       snow_ind       < 4.217704   to the right, improve=0.1613810, (0 missing)
##   Surrogate splits:
##       wtd_north_per < 18.92953   to the right, agree=0.927, adj=0.767, (0 split)
##       dist_coast_km < 88.8493    to the left,  agree=0.833, adj=0.467, (0 split)
##       log_cat_elev  < 1.942254   to the left,  agree=0.812, adj=0.400, (0 split)
##       log_area      < 1.095445   to the left,  agree=0.812, adj=0.400, (0 split)
##       log_slope     < 2.894404   to the right, agree=0.750, adj=0.200, (0 split)
## 
## Node number 8: 119 observations
##   mean=0.1143269, MSE=0.004893648 
## 
## Node number 9: 212 observations,    complexity param=0.03959423
##   mean=0.1876967, MSE=0.009913384 
##   left son=18 (113 obs) right son=19 (99 obs)
##   Primary splits:
##       log_area      < 1.870553   to the left,  improve=0.2112914, (0 missing)
##       asrt_wet      < 0.01692271 to the left,  improve=0.1637302, (0 missing)
##       asrt_lake     < 0.1972299  to the left,  improve=0.1358968, (0 missing)
##       dist_coast_km < 54.9791    to the left,  improve=0.1353225, (0 missing)
##       asrt_glac     < 0.04350381 to the left,  improve=0.1298622, (0 missing)
##   Surrogate splits:
##       log_slope      < 2.025229   to the right, agree=0.774, adj=0.515, (0 split)
##       log_cat_slope  < 0.5248518  to the right, agree=0.712, adj=0.384, (0 split)
##       wtd_north_per  < 17.52591   to the left,  agree=0.708, adj=0.374, (0 split)
##       asrt_glac      < 0.0204009  to the left,  agree=0.670, adj=0.293, (0 split)
##       wtd_slope_MEAN < 16.69041   to the left,  agree=0.656, adj=0.263, (0 split)
## 
## Node number 12: 161 observations,    complexity param=0.02043613
##   mean=0.2390388, MSE=0.008385419 
##   left son=24 (17 obs) right son=25 (144 obs)
##   Primary splits:
##       log_cat_elev  < 1.117729   to the left,  improve=0.15859900, (0 missing)
##       dist_coast_km < 63.9997    to the left,  improve=0.09188451, (0 missing)
##       wtd_north_per < 29.54303   to the left,  improve=0.07801265, (0 missing)
##       asrt_wet      < 0.1877954  to the right, improve=0.07148963, (0 missing)
##       asrt_lake     < 0.1777405  to the right, improve=0.07138524, (0 missing)
##   Surrogate splits:
##       asrt_lake < 0.5352377  to the right, agree=0.919, adj=0.235, (0 split)
##       log_area  < 3.485453   to the right, agree=0.913, adj=0.176, (0 split)
##       asrt_glac < 0.02499424 to the right, agree=0.913, adj=0.176, (0 split)
## 
## Node number 13: 10 observations
##   mean=0.4306292, MSE=0.007524608 
## 
## Node number 14: 30 observations
##   mean=0.3122156, MSE=0.003685414 
## 
## Node number 15: 66 observations,    complexity param=0.02267671
##   mean=0.4384647, MSE=0.00749607 
##   left son=30 (52 obs) right son=31 (14 obs)
##   Primary splits:
##       wtd_north_per < 18.50283   to the left,  improve=0.4802364, (0 missing)
##       log_area      < 1.68989    to the right, improve=0.2834996, (0 missing)
##       log_slope     < 2.569185   to the left,  improve=0.2834996, (0 missing)
##       asrt_lake     < 0.140912   to the left,  improve=0.2809373, (0 missing)
##       log_cat_elev  < 2.41235    to the left,  improve=0.2414508, (0 missing)
##   Surrogate splits:
##       log_cat_elev   < 2.41235    to the left,  agree=0.894, adj=0.500, (0 split)
##       log_cat_slope  < 0.6834351  to the left,  agree=0.894, adj=0.500, (0 split)
##       wtd_slope_MEAN < 2.920316   to the right, agree=0.894, adj=0.500, (0 split)
##       asrt_wet       < 0.01637946 to the right, agree=0.894, adj=0.500, (0 split)
##       dist_coast_km  < 103.6483   to the left,  agree=0.833, adj=0.214, (0 split)
## 
## Node number 18: 113 observations,    complexity param=0.01585383
##   mean=0.1448586, MSE=0.004767159 
##   left son=36 (70 obs) right son=37 (43 obs)
##   Primary splits:
##       dist_coast_km  < 43.94194   to the left,  improve=0.3083534, (0 missing)
##       asrt_wet       < 0.09550369 to the left,  improve=0.3083286, (0 missing)
##       log_cat_elev   < 1.828841   to the right, improve=0.2147218, (0 missing)
##       wtd_slope_MEAN < 14.0371    to the left,  improve=0.1690403, (0 missing)
##       asrt_lake      < 0.2564517  to the left,  improve=0.1245342, (0 missing)
##   Surrogate splits:
##       asrt_wet      < 0.1178873  to the left,  agree=0.858, adj=0.628, (0 split)
##       asrt_lake     < 0.2564517  to the left,  agree=0.779, adj=0.419, (0 split)
##       log_cat_elev  < 1.825269   to the right, agree=0.743, adj=0.326, (0 split)
##       wtd_north_per < 15.61472   to the right, agree=0.743, adj=0.326, (0 split)
##       log_area      < 0.9492256  to the right, agree=0.743, adj=0.326, (0 split)
## 
## Node number 19: 99 observations,    complexity param=0.02031043
##   mean=0.2365927, MSE=0.01130192 
##   left son=38 (58 obs) right son=39 (41 obs)
##   Primary splits:
##       asrt_lake     < 0.1174673  to the left,  improve=0.1901884, (0 missing)
##       snow_ind      < 16.59777   to the left,  improve=0.1887303, (0 missing)
##       wtd_north_per < 18.52514   to the left,  improve=0.1855141, (0 missing)
##       dist_coast_km < 53.72947   to the left,  improve=0.1451229, (0 missing)
##       asrt_wet      < 0.09712011 to the right, improve=0.1263573, (0 missing)
##   Surrogate splits:
##       asrt_wet       < 0.03421111 to the right, agree=0.869, adj=0.683, (0 split)
##       log_cat_elev   < 1.744114   to the left,  agree=0.848, adj=0.634, (0 split)
##       wtd_slope_MEAN < 12.67679   to the right, agree=0.808, adj=0.537, (0 split)
##       wtd_north_per  < 18.52514   to the left,  agree=0.788, adj=0.488, (0 split)
##       log_area       < 2.862948   to the left,  agree=0.788, adj=0.488, (0 split)
## 
## Node number 24: 17 observations
##   mean=0.1329012, MSE=0.007197582 
## 
## Node number 25: 144 observations
##   mean=0.251569, MSE=0.007038726 
## 
## Node number 30: 52 observations
##   mean=0.4073327, MSE=0.00379822 
## 
## Node number 31: 14 observations
##   mean=0.5540978, MSE=0.004260054 
## 
## Node number 36: 70 observations
##   mean=0.114809, MSE=0.002861187 
## 
## Node number 37: 43 observations
##   mean=0.1937767, MSE=0.004006961 
## 
## Node number 38: 58 observations
##   mean=0.1976124, MSE=0.005299542 
## 
## Node number 39: 41 observations,    complexity param=0.01560501
##   mean=0.2917357, MSE=0.01460286 
##   left son=78 (34 obs) right son=79 (7 obs)
##   Primary splits:
##       snow_ind      < 14.23106   to the left,  improve=0.27308330, (0 missing)
##       log_area      < 3.097242   to the right, improve=0.12753860, (0 missing)
##       log_slope     < 1.888294   to the left,  improve=0.09216125, (0 missing)
##       asrt_glac     < 0.05627204 to the right, improve=0.08287556, (0 missing)
##       log_cat_slope < 0.5178313  to the left,  improve=0.06448692, (0 missing)
##   Surrogate splits:
##       log_cat_elev < 1.433653   to the right, agree=0.854, adj=0.143, (0 split)
##       asrt_wet     < 0.1627986  to the left,  agree=0.854, adj=0.143, (0 split)
##       asrt_lake    < 0.3716728  to the left,  agree=0.854, adj=0.143, (0 split)
## 
## Node number 78: 34 observations
##   mean=0.2630823, MSE=0.006950726 
## 
## Node number 79: 7 observations
##   mean=0.4309093, MSE=0.02841325

7.3 Kodiak Regression Tree

ct_kod <- rpart(TempSens ~ log_slope + log_cat_elev + log_cat_slope + wtd_north_per +
                      wtd_slope_MEAN + log_area + dist_coast_km + asrt_wet + 
                      asrt_glac + asrt_lake + snow_ind + summer_precip, 
                    data = mod_dat %>% filter(Region == "Kodiak"), method = "anova")
plotcp(ct_kod) 

printcp(ct_kod) 
## 
## Regression tree:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Kodiak"), method = "anova")
## 
## Variables actually used in tree construction:
## [1] asrt_wet      log_area      log_cat_slope snow_ind      summer_precip
## 
## Root node error: 1.6995/112 = 0.015174
## 
## n= 112 
## 
##         CP nsplit rel error  xerror    xstd
## 1 0.172697      0   1.00000 1.00813 0.18730
## 2 0.136208      1   0.82730 1.04543 0.19542
## 3 0.090861      2   0.69110 1.01170 0.19535
## 4 0.053756      3   0.60023 0.98639 0.17634
## 5 0.033359      4   0.54648 0.88893 0.16815
## 6 0.025739      5   0.51312 0.87014 0.15813
## 7 0.013759      6   0.48738 0.87575 0.15903
## 8 0.010000      7   0.47362 0.85670 0.15230
cp_parm <- 0.053756      
ct_kodpr <- prune(ct_kod, cp = cp_parm)

par(xpd = TRUE)
plot(ct_kodpr, compress = TRUE)
text(ct_kodpr, use.n = TRUE)

Summary table indicates variable importance and also lists surrogate splits. Interesting that snow index and precipitation are the least important variables.

summary(ct_kodpr)
## Call:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Kodiak"), method = "anova")
##   n= 112 
## 
##           CP nsplit rel error    xerror      xstd
## 1 0.17269692      0 1.0000000 1.0081267 0.1873029
## 2 0.13620782      1 0.8273031 1.0454284 0.1954172
## 3 0.09086104      2 0.6910953 1.0117014 0.1953526
## 4 0.05375600      3 0.6002342 0.9863858 0.1763418
## 
## Variable importance
##       log_area       asrt_wet  wtd_north_per      log_slope wtd_slope_MEAN 
##             17             16             13             13             12 
##       snow_ind  log_cat_slope   log_cat_elev      asrt_glac 
##             10              9              6              5 
## 
## Node number 1: 112 observations,    complexity param=0.1726969
##   mean=0.2582698, MSE=0.0151737 
##   left son=2 (67 obs) right son=3 (45 obs)
##   Primary splits:
##       asrt_wet       < 0.1826873  to the left,  improve=0.1726969, (0 missing)
##       wtd_north_per  < 25.35906   to the right, improve=0.1527063, (0 missing)
##       log_cat_elev   < 1.638385   to the left,  improve=0.1433621, (0 missing)
##       wtd_slope_MEAN < 18.39747   to the right, improve=0.1233673, (0 missing)
##       log_slope      < 3.650677   to the right, improve=0.1223966, (0 missing)
##   Surrogate splits:
##       wtd_north_per  < 24.28999   to the right, agree=0.893, adj=0.733, (0 split)
##       wtd_slope_MEAN < 15.79473   to the right, agree=0.884, adj=0.711, (0 split)
##       log_area       < 2.140731   to the left,  agree=0.812, adj=0.533, (0 split)
##       snow_ind       < -22.1083   to the right, agree=0.812, adj=0.533, (0 split)
##       log_slope      < 3.20921    to the right, agree=0.786, adj=0.467, (0 split)
## 
## Node number 2: 67 observations,    complexity param=0.09086104
##   mean=0.2163174, MSE=0.009518571 
##   left son=4 (21 obs) right son=5 (46 obs)
##   Primary splits:
##       log_area       < 1.915582   to the right, improve=0.2421255, (0 missing)
##       wtd_north_per  < 25.35906   to the right, improve=0.2001399, (0 missing)
##       dist_coast_km  < 1.170811   to the right, improve=0.1863559, (0 missing)
##       snow_ind       < 13.4615    to the right, improve=0.1662517, (0 missing)
##       wtd_slope_MEAN < 18.39747   to the right, improve=0.1363734, (0 missing)
##   Surrogate splits:
##       asrt_wet     < 0.04015049 to the left,  agree=0.940, adj=0.810, (0 split)
##       asrt_glac    < 0.03130361 to the right, agree=0.940, adj=0.810, (0 split)
##       snow_ind     < 0.7964432  to the right, agree=0.881, adj=0.619, (0 split)
##       log_slope    < 3.650677   to the right, agree=0.866, adj=0.571, (0 split)
##       log_cat_elev < 1.563919   to the left,  agree=0.776, adj=0.286, (0 split)
## 
## Node number 3: 45 observations,    complexity param=0.1362078
##   mean=0.3207322, MSE=0.01707154 
##   left son=6 (27 obs) right son=7 (18 obs)
##   Primary splits:
##       log_cat_slope  < 0.9601659  to the left,  improve=0.3013188, (0 missing)
##       wtd_north_per  < 23.45947   to the left,  improve=0.2911799, (0 missing)
##       log_cat_elev   < 1.823281   to the left,  improve=0.2865467, (0 missing)
##       wtd_slope_MEAN < 13.95583   to the left,  improve=0.2864768, (0 missing)
##       dist_coast_km  < 1.703715   to the left,  improve=0.2049299, (0 missing)
##   Surrogate splits:
##       log_area       < 1.808632   to the right, agree=0.844, adj=0.611, (0 split)
##       wtd_north_per  < 23.45947   to the left,  agree=0.822, adj=0.556, (0 split)
##       log_cat_elev   < 2.114377   to the left,  agree=0.800, adj=0.500, (0 split)
##       log_slope      < 2.967167   to the left,  agree=0.778, adj=0.444, (0 split)
##       wtd_slope_MEAN < 16.61288   to the left,  agree=0.778, adj=0.444, (0 split)
## 
## Node number 4: 21 observations
##   mean=0.1452655, MSE=0.0115241 
## 
## Node number 5: 46 observations
##   mean=0.2487541, MSE=0.005246174 
## 
## Node number 6: 27 observations
##   mean=0.2621719, MSE=0.01180659 
## 
## Node number 7: 18 observations
##   mean=0.4085728, MSE=0.01210902

7.4 Prince William Sound Regression Tree

ct_pws <- rpart(TempSens ~ log_slope + log_cat_elev + log_cat_slope + wtd_north_per +
                      wtd_slope_MEAN + log_area + dist_coast_km + asrt_wet + 
                      asrt_glac + asrt_lake + snow_ind + summer_precip, 
                    data = mod_dat %>% filter(Region == "Prince_William_Sound"), method = "anova")
 # plotcp(ct_pws) 
 # printcp(ct_pws) 
cp_parm <- 0.020529      
ct_pwspr <- prune(ct_pws, cp = cp_parm)

par(xpd = TRUE)
plot(ct_pwspr, compress = TRUE)
text(ct_pwspr, use.n = TRUE)

Summary table indicates variable importance and also lists surrogate splits. Interesting that snow index and precipitation are the least important variables.

summary(ct_pwspr)
## Call:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Prince_William_Sound"), 
##     method = "anova")
##   n= 84 
## 
##           CP nsplit rel error    xerror      xstd
## 1 0.20640694      0 1.0000000 1.0146950 0.1800804
## 2 0.06961556      2 0.5871861 0.8777416 0.1430107
## 3 0.02052914      4 0.4479550 0.8237142 0.1422949
## 4 0.01000000      5 0.4274259 0.7816880 0.1297914
## 
## Variable importance
##  dist_coast_km       snow_ind      log_slope      asrt_glac wtd_slope_MEAN 
##             16             13             12             11              9 
##   log_cat_elev       log_area       asrt_wet  log_cat_slope  summer_precip 
##              9              9              8              7              2 
##  wtd_north_per      asrt_lake 
##              2              1 
## 
## Node number 1: 84 observations,    complexity param=0.2064069
##   mean=0.1543175, MSE=0.005652681 
##   left son=2 (12 obs) right son=3 (72 obs)
##   Primary splits:
##       asrt_glac < 0.3719847  to the right, improve=0.1936529, (0 missing)
##       log_area  < 1.241879   to the right, improve=0.1856081, (0 missing)
##       asrt_wet  < 0.1619669  to the left,  improve=0.1849498, (0 missing)
##       asrt_lake < 0.09511998 to the left,  improve=0.1606461, (0 missing)
##       snow_ind  < 32.68797   to the right, improve=0.1422396, (0 missing)
##   Surrogate splits:
##       snow_ind      < 26.63218   to the right, agree=0.976, adj=0.833, (0 split)
##       log_cat_elev  < 0.8542554  to the left,  agree=0.952, adj=0.667, (0 split)
##       log_area      < 1.605738   to the right, agree=0.952, adj=0.667, (0 split)
##       log_slope     < 2.239284   to the left,  agree=0.905, adj=0.333, (0 split)
##       log_cat_slope < 0.06807852 to the left,  agree=0.905, adj=0.333, (0 split)
## 
## Node number 2: 12 observations
##   mean=0.07327463, MSE=0.0008912949 
## 
## Node number 3: 72 observations,    complexity param=0.2064069
##   mean=0.1678247, MSE=0.005169144 
##   left son=6 (60 obs) right son=7 (12 obs)
##   Primary splits:
##       dist_coast_km  < 0.3968941  to the left,  improve=0.2796056, (0 missing)
##       snow_ind       < 17.2457    to the left,  improve=0.2321811, (0 missing)
##       log_slope      < 2.613458   to the right, improve=0.2293038, (0 missing)
##       wtd_north_per  < 13.26783   to the right, improve=0.1479013, (0 missing)
##       wtd_slope_MEAN < 20.31589   to the right, improve=0.1453852, (0 missing)
##   Surrogate splits:
##       log_slope      < 2.613458   to the right, agree=0.944, adj=0.667, (0 split)
##       wtd_slope_MEAN < 7.965435   to the right, agree=0.917, adj=0.500, (0 split)
##       snow_ind       < 16.94275   to the left,  agree=0.889, adj=0.333, (0 split)
##       summer_precip  < 1071.135   to the left,  agree=0.847, adj=0.083, (0 split)
## 
## Node number 6: 60 observations,    complexity param=0.06961556
##   mean=0.1508228, MSE=0.003353777 
##   left son=12 (46 obs) right son=13 (14 obs)
##   Primary splits:
##       asrt_wet      < 0.6253479  to the left,  improve=0.15016170, (0 missing)
##       snow_ind      < -3.792405  to the right, improve=0.13856710, (0 missing)
##       log_cat_elev  < 1.265175   to the left,  improve=0.11760140, (0 missing)
##       wtd_north_per < 9.091962   to the right, improve=0.08941983, (0 missing)
##       log_cat_slope < 0.673673   to the right, improve=0.08941983, (0 missing)
##   Surrogate splits:
##       log_cat_slope  < 0.673673   to the right, agree=0.883, adj=0.500, (0 split)
##       wtd_north_per  < 9.091962   to the right, agree=0.883, adj=0.500, (0 split)
##       wtd_slope_MEAN < 8.44062    to the right, agree=0.850, adj=0.357, (0 split)
##       dist_coast_km  < 0.3313525  to the left,  agree=0.850, adj=0.357, (0 split)
##       asrt_lake      < 0.1608113  to the left,  agree=0.833, adj=0.286, (0 split)
## 
## Node number 7: 12 observations
##   mean=0.2528341, MSE=0.005574049 
## 
## Node number 12: 46 observations,    complexity param=0.06961556
##   mean=0.1384425, MSE=0.002554224 
##   left son=24 (28 obs) right son=25 (18 obs)
##   Primary splits:
##       asrt_wet      < 0.06871431 to the right, improve=0.30549480, (0 missing)
##       log_slope     < 3.038788   to the left,  improve=0.13905370, (0 missing)
##       dist_coast_km < 0.02373949 to the right, improve=0.10396140, (0 missing)
##       log_cat_slope < 0.9520146  to the left,  improve=0.09554842, (0 missing)
##       log_cat_elev  < 1.273416   to the left,  improve=0.09554842, (0 missing)
##   Surrogate splits:
##       dist_coast_km  < 0.02373949 to the right, agree=0.826, adj=0.556, (0 split)
##       log_cat_elev   < 1.361675   to the left,  agree=0.783, adj=0.444, (0 split)
##       log_cat_slope  < 1.101837   to the left,  agree=0.783, adj=0.444, (0 split)
##       wtd_slope_MEAN < 28.73653   to the left,  agree=0.783, adj=0.444, (0 split)
##       log_area       < 1.458743   to the left,  agree=0.761, adj=0.389, (0 split)
## 
## Node number 13: 14 observations
##   mean=0.191501, MSE=0.003822555 
## 
## Node number 24: 28 observations,    complexity param=0.02052914
##   mean=0.1160455, MSE=0.002385075 
##   left son=48 (12 obs) right son=49 (16 obs)
##   Primary splits:
##       summer_precip  < 800.37     to the left,  improve=0.14596350, (0 missing)
##       snow_ind       < -8.507497  to the right, improve=0.05504749, (0 missing)
##       wtd_slope_MEAN < 15.77022   to the right, improve=0.03717572, (0 missing)
##       asrt_wet       < 0.3518783  to the left,  improve=0.03717572, (0 missing)
##       log_cat_elev   < 1.605071   to the right, improve=0.02364759, (0 missing)
##   Surrogate splits:
##       log_slope      < 3.162494   to the right, agree=0.643, adj=0.167, (0 split)
##       log_cat_elev   < 1.605071   to the right, agree=0.643, adj=0.167, (0 split)
##       log_cat_slope  < 1.171206   to the right, agree=0.643, adj=0.167, (0 split)
##       wtd_north_per  < 13.83068   to the left,  agree=0.643, adj=0.167, (0 split)
##       wtd_slope_MEAN < 23.82592   to the right, agree=0.643, adj=0.167, (0 split)
## 
## Node number 25: 18 observations
##   mean=0.1732821, MSE=0.0008232395 
## 
## Node number 48: 12 observations
##   mean=0.09450071, MSE=0.003238041 
## 
## Node number 49: 16 observations
##   mean=0.1322041, MSE=0.001136117

7.5 Copper River Regression Tree

ct_cr <- rpart(TempSens ~ log_slope + log_cat_elev + log_cat_slope + wtd_north_per +
                      wtd_slope_MEAN + log_area + dist_coast_km + asrt_wet + 
                      asrt_glac + asrt_lake + snow_ind + summer_precip, 
                    data = mod_dat %>% filter(Region == "Copper_River"), method = "anova")
 plotcp(ct_cr) 

 printcp(ct_cr) 
## 
## Regression tree:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Copper_River"), method = "anova")
## 
## Variables actually used in tree construction:
## [1] asrt_lake     dist_coast_km log_cat_slope log_slope     summer_precip
## [6] wtd_north_per
## 
## Root node error: 3.5239/156 = 0.022589
## 
## n= 156 
## 
##         CP nsplit rel error  xerror     xstd
## 1 0.199510      0   1.00000 1.00970 0.137552
## 2 0.068681      2   0.60098 0.71115 0.099620
## 3 0.065404      3   0.53230 0.70489 0.101103
## 4 0.030690      4   0.46689 0.56987 0.084480
## 5 0.016967      6   0.40551 0.47276 0.075779
## 6 0.011897      7   0.38855 0.46095 0.075024
## 7 0.010826      8   0.37665 0.45738 0.075049
## 8 0.010000      9   0.36582 0.45738 0.075049
cp_parm <- 0.010826      
ct_crpr <- prune(ct_cr, cp = cp_parm)

par(xpd = TRUE)
plot(ct_crpr, compress = TRUE)
text(ct_crpr, use.n = TRUE)

Summary table indicates variable importance and also lists surrogate splits. Interesting that snow index and precipitation are the least important variables.

summary(ct_crpr)
## Call:
## rpart(formula = TempSens ~ log_slope + log_cat_elev + log_cat_slope + 
##     wtd_north_per + wtd_slope_MEAN + log_area + dist_coast_km + 
##     asrt_wet + asrt_glac + asrt_lake + snow_ind + summer_precip, 
##     data = mod_dat %>% filter(Region == "Copper_River"), method = "anova")
##   n= 156 
## 
##           CP nsplit rel error    xerror       xstd
## 1 0.19951033      0 1.0000000 1.0096982 0.13755222
## 2 0.06868147      2 0.6009793 0.7111534 0.09962036
## 3 0.06540415      3 0.5322979 0.7048927 0.10110259
## 4 0.03069013      4 0.4668937 0.5698664 0.08447964
## 5 0.01696685      6 0.4055135 0.4727630 0.07577888
## 6 0.01189721      7 0.3885466 0.4609529 0.07502403
## 7 0.01082611      8 0.3766494 0.4573755 0.07504917
## 8 0.01000000      9 0.3658233 0.4573755 0.07504917
## 
## Variable importance
##  wtd_north_per      asrt_lake       log_area wtd_slope_MEAN  log_cat_slope 
##             22             14             11             11             10 
##       asrt_wet   log_cat_elev      log_slope       snow_ind  dist_coast_km 
##              8              7              5              4              4 
##  summer_precip      asrt_glac 
##              3              2 
## 
## Node number 1: 156 observations,    complexity param=0.1995103
##   mean=0.2523254, MSE=0.02258917 
##   left son=2 (47 obs) right son=3 (109 obs)
##   Primary splits:
##       asrt_lake      < 0.04054766 to the left,  improve=0.1957602, (0 missing)
##       wtd_slope_MEAN < 9.456658   to the left,  improve=0.1941931, (0 missing)
##       log_slope      < 2.547967   to the right, improve=0.1746716, (0 missing)
##       log_cat_elev   < 1.113724   to the right, improve=0.1273075, (0 missing)
##       asrt_wet       < 0.1681871  to the left,  improve=0.1252362, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 3.642079   to the left,  agree=0.827, adj=0.426, (0 split)
##       wtd_north_per  < 15.96833   to the left,  agree=0.821, adj=0.404, (0 split)
##       log_area       < 0.2641206  to the left,  agree=0.801, adj=0.340, (0 split)
##       asrt_wet       < 0.05108343 to the left,  agree=0.795, adj=0.319, (0 split)
##       log_cat_slope  < 0.918896   to the right, agree=0.782, adj=0.277, (0 split)
## 
## Node number 2: 47 observations,    complexity param=0.03069013
##   mean=0.1510564, MSE=0.008680495 
##   left son=4 (23 obs) right son=5 (24 obs)
##   Primary splits:
##       dist_coast_km < 3.028465   to the left,  improve=0.2415932, (0 missing)
##       log_cat_slope < 0.4316709  to the left,  improve=0.2201768, (0 missing)
##       log_area      < -0.4036934 to the left,  improve=0.1412109, (0 missing)
##       log_slope     < 3.326182   to the left,  improve=0.1407043, (0 missing)
##       wtd_north_per < 8.571987   to the right, improve=0.1407043, (0 missing)
##   Surrogate splits:
##       log_cat_elev  < 1.91362    to the left,  agree=0.957, adj=0.913, (0 split)
##       wtd_north_per < 15.77051   to the right, agree=0.830, adj=0.652, (0 split)
##       log_area      < 0.4603243  to the left,  agree=0.766, adj=0.522, (0 split)
##       asrt_wet      < 0.4283984  to the right, agree=0.766, adj=0.522, (0 split)
##       summer_precip < 441.1      to the right, agree=0.766, adj=0.522, (0 split)
## 
## Node number 3: 109 observations,    complexity param=0.1995103
##   mean=0.2959919, MSE=0.02225767 
##   left son=6 (70 obs) right son=7 (39 obs)
##   Primary splits:
##       wtd_north_per  < 17.62766   to the right, improve=0.2952375, (0 missing)
##       asrt_wet       < 0.1681871  to the left,  improve=0.2791875, (0 missing)
##       log_cat_slope  < 0.5908003  to the right, improve=0.2133116, (0 missing)
##       wtd_slope_MEAN < 9.456658   to the left,  improve=0.1860336, (0 missing)
##       log_cat_elev   < 1.646404   to the right, improve=0.1312556, (0 missing)
##   Surrogate splits:
##       snow_ind       < -8.470063  to the right, agree=0.789, adj=0.410, (0 split)
##       log_area       < 0.8209101  to the right, agree=0.734, adj=0.256, (0 split)
##       wtd_slope_MEAN < 18.29991   to the left,  agree=0.725, adj=0.231, (0 split)
##       log_cat_elev   < 1.148358   to the right, agree=0.706, adj=0.179, (0 split)
##       dist_coast_km  < 214.1562   to the left,  agree=0.688, adj=0.128, (0 split)
## 
## Node number 4: 23 observations
##   mean=0.1042768, MSE=0.00271017 
## 
## Node number 5: 24 observations,    complexity param=0.03069013
##   mean=0.1958868, MSE=0.01029514 
##   left son=10 (10 obs) right son=11 (14 obs)
##   Primary splits:
##       log_cat_slope  < 0.1970438  to the left,  improve=0.4764894, (0 missing)
##       wtd_slope_MEAN < 1.684085   to the left,  improve=0.4764894, (0 missing)
##       snow_ind       < -10.20251  to the right, improve=0.3737741, (0 missing)
##       summer_precip  < 245.115    to the left,  improve=0.3179524, (0 missing)
##       log_cat_elev   < 2.752237   to the right, improve=0.2531090, (0 missing)
##   Surrogate splits:
##       wtd_slope_MEAN < 1.684085   to the left,  agree=1.000, adj=1.0, (0 split)
##       log_slope      < 2.808827   to the left,  agree=0.917, adj=0.8, (0 split)
##       asrt_wet       < 0.2277379  to the right, agree=0.917, adj=0.8, (0 split)
##       wtd_north_per  < 9.491646   to the right, agree=0.875, adj=0.7, (0 split)
##       summer_precip  < 245.115    to the left,  agree=0.875, adj=0.7, (0 split)
## 
## Node number 6: 70 observations,    complexity param=0.06540415
##   mean=0.2354844, MSE=0.01248634 
##   left son=12 (43 obs) right son=13 (27 obs)
##   Primary splits:
##       log_slope      < 2.785705   to the left,  improve=0.2636920, (0 missing)
##       asrt_lake      < 0.1820288  to the left,  improve=0.2451953, (0 missing)
##       wtd_slope_MEAN < 9.456658   to the left,  improve=0.2157548, (0 missing)
##       wtd_north_per  < 19.95784   to the left,  improve=0.2157548, (0 missing)
##       log_cat_slope  < 0.5672449  to the right, improve=0.2094631, (0 missing)
##   Surrogate splits:
##       wtd_north_per < 27.50359   to the left,  agree=0.886, adj=0.704, (0 split)
##       log_cat_elev  < 2.656721   to the left,  agree=0.871, adj=0.667, (0 split)
##       log_area      < 1.941635   to the left,  agree=0.871, adj=0.667, (0 split)
##       asrt_lake     < 0.1820288  to the left,  agree=0.843, adj=0.593, (0 split)
##       log_cat_slope < 0.4513116  to the right, agree=0.771, adj=0.407, (0 split)
## 
## Node number 7: 39 observations,    complexity param=0.06868147
##   mean=0.404595, MSE=0.02143001 
##   left son=14 (29 obs) right son=15 (10 obs)
##   Primary splits:
##       log_cat_slope < 0.4489423  to the right, improve=0.2895860, (0 missing)
##       summer_precip < 642.31     to the left,  improve=0.2285347, (0 missing)
##       log_cat_elev  < 1.474088   to the right, improve=0.2152557, (0 missing)
##       dist_coast_km < 71.1501    to the right, improve=0.1736913, (0 missing)
##       log_slope     < 2.65424    to the right, improve=0.1110592, (0 missing)
##   Surrogate splits:
##       wtd_north_per  < 11.38501   to the right, agree=0.897, adj=0.6, (0 split)
##       wtd_slope_MEAN < 22.22776   to the left,  agree=0.897, adj=0.6, (0 split)
##       asrt_glac      < 0.1184769  to the left,  agree=0.897, adj=0.6, (0 split)
##       asrt_wet       < 0.4570558  to the left,  agree=0.846, adj=0.4, (0 split)
##       log_area       < 1.630992   to the left,  agree=0.821, adj=0.3, (0 split)
## 
## Node number 10: 10 observations
##   mean=0.113015, MSE=0.000333695 
## 
## Node number 11: 14 observations
##   mean=0.2550809, MSE=0.009000985 
## 
## Node number 12: 43 observations,    complexity param=0.01696685
##   mean=0.1900156, MSE=0.00644034 
##   left son=24 (35 obs) right son=25 (8 obs)
##   Primary splits:
##       asrt_lake     < 0.04704138 to the right, improve=0.2158981, (0 missing)
##       log_cat_slope < 0.5672449  to the right, improve=0.2110783, (0 missing)
##       dist_coast_km < 72.53025   to the right, improve=0.2019420, (0 missing)
##       log_slope     < 1.538951   to the right, improve=0.2019420, (0 missing)
##       log_cat_elev  < 2.185634   to the right, improve=0.2019420, (0 missing)
##   Surrogate splits:
##       log_cat_slope < 0.5672449  to the right, agree=0.884, adj=0.375, (0 split)
##       asrt_wet      < 0.2460655  to the left,  agree=0.860, adj=0.250, (0 split)
## 
## Node number 13: 27 observations
##   mean=0.3078977, MSE=0.01357893 
## 
## Node number 14: 29 observations,    complexity param=0.01189721
##   mean=0.3583355, MSE=0.008483556 
##   left son=28 (12 obs) right son=29 (17 obs)
##   Primary splits:
##       dist_coast_km < 69.896     to the right, improve=0.1704096, (0 missing)
##       log_cat_elev  < 2.094433   to the right, improve=0.1704096, (0 missing)
##       wtd_north_per < 15.41724   to the left,  improve=0.1704096, (0 missing)
##       log_area      < 1.151743   to the right, improve=0.1704096, (0 missing)
##       asrt_wet      < 0.3165056  to the left,  improve=0.1704096, (0 missing)
##   Surrogate splits:
##       log_cat_elev  < 2.094433   to the right, agree=1.000, adj=1.000, (0 split)
##       wtd_north_per < 15.41724   to the left,  agree=1.000, adj=1.000, (0 split)
##       log_area      < 1.151743   to the right, agree=1.000, adj=1.000, (0 split)
##       asrt_wet      < 0.3165056  to the left,  agree=1.000, adj=1.000, (0 split)
##       summer_precip < 452.635    to the left,  agree=0.931, adj=0.833, (0 split)
## 
## Node number 15: 10 observations
##   mean=0.5387476, MSE=0.034772 
## 
## Node number 24: 35 observations,    complexity param=0.01082611
##   mean=0.1721881, MSE=0.004402789 
##   left son=48 (17 obs) right son=49 (18 obs)
##   Primary splits:
##       summer_precip < 437.5      to the left,  improve=0.2475720, (0 missing)
##       dist_coast_km < 70.74312   to the right, improve=0.1684327, (0 missing)
##       log_slope     < 1.538951   to the right, improve=0.1684327, (0 missing)
##       asrt_lake     < 0.1170766  to the right, improve=0.1684327, (0 missing)
##       log_cat_elev  < 2.185634   to the right, improve=0.1684327, (0 missing)
##   Surrogate splits:
##       log_slope     < 1.538951   to the right, agree=0.943, adj=0.882, (0 split)
##       log_cat_elev  < 2.185634   to the right, agree=0.943, adj=0.882, (0 split)
##       dist_coast_km < 70.74312   to the right, agree=0.943, adj=0.882, (0 split)
##       asrt_lake     < 0.1170766  to the right, agree=0.943, adj=0.882, (0 split)
##       wtd_north_per < 20.63854   to the left,  agree=0.829, adj=0.647, (0 split)
## 
## Node number 25: 8 observations
##   mean=0.2680108, MSE=0.007880917 
## 
## Node number 28: 12 observations
##   mean=0.3130802, MSE=0.0103692 
## 
## Node number 29: 17 observations
##   mean=0.3902805, MSE=0.004686358 
## 
## Node number 48: 17 observations
##   mean=0.1382157, MSE=0.002794271 
## 
## Node number 49: 18 observations
##   mean=0.2042732, MSE=0.003802487

8 Post-hoc exploration of regional TS

For each region, the number of sites is listed along with a table showing the years for each site, and pairplots of TS against each of the covariates (separated into two plots since there are so many).

Copper River

region_in <- "Copper_River"

print(paste0(region_in, ": ", nrow(mod_dat %>% filter(Region == region_in) %>% distinct(Site)), " sites"))
## [1] "Copper_River: 27 sites"
mod_dat %>% 
  filter(Region == region_in) %>% 
  group_by(Site) %>% 
  summarize(years = paste(Year, collapse = ", ")) %>% 
  kable(longtable = TRUE) %>%
  kable_styling()
Site years
fws_Long Lake Creek 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
fws_Tanada Creek 2009, 2010, 2013, 2014, 2015, 2016, 2017, 2019
NPS_Caribou Creek 2008, 2009, 2010, 2011, 2012
NPS_Crystal Creek 2011, 2012, 2013, 2014
NPS_Gilahina River 2008, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
NPS_Lakina River 2008
NPS_Long Lake Creek 2008, 2011, 2012, 2013, 2014
NPS_Rock Creek WRST 2010, 2011, 2012, 2018
NPS_Rufus Creek 2009, 2010, 2011, 2012, 2014, 2015, 2016, 2017, 2018, 2019
USFS_18 Mile 2019
USFS_18 Mile Middle Fork 2013, 2014, 2017, 2018
USFS_18 Mile West Fork 2013, 2017
USFS_24.9 Mile Creek 2013, 2014, 2016, 2017, 2018
USFS_25 Mile 2011, 2012, 2014, 2015, 2016, 2017, 2018, 2019
USFS_Blackhole Creek 2014, 2015, 2016, 2017, 2018, 2019
USFS_Cabin Lake Outlet 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
USFS_East Fork 18 Mile 2010, 2011, 2012, 2014, 2015, 2016, 2017, 2018
USFS_Eyak Lake Tributary 2019
USFS_Hook Point 2014, 2015, 2016, 2017, 2018, 2019
USFS_Ibeck Creek-Low 2016, 2017, 2018, 2019
USFS_Ibeck Creek-Lower Side Channel 2013, 2014
USFS_Little Martin River 2011, 2012, 2013, 2014, 2016, 2017, 2018, 2019
USFS_Martin Lake- Inlet 2011, 2012, 2013, 2014, 2016, 2017, 2018, 2019
USFS_Power Creek 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2018, 2019
USFS_Salmon Creek 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15200280 2016, 2018, 2019
usgs_15215900 2013, 2014, 2015, 2016, 2017, 2018, 2019
mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_slope, log_cat_elev, log_cat_slope, 
         wtd_slope_MEAN, snow_ind, wtd_lcld_jd, summer_precip) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_area, dist_coast_km, wtd_north_per,
         asrt_wet, asrt_glac, asrt_lake, glac_10) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

Kodiak

region_in <- "Kodiak"

print(paste0(region_in, ": ", nrow(mod_dat %>% filter(Region == region_in) %>% distinct(Site)), " sites"))
## [1] "Kodiak: 31 sites"
mod_dat %>% 
  filter(Region == region_in) %>% 
  group_by(Site) %>% 
  summarize(years = paste(Year, collapse = ", ")) %>% 
  kable(longtable = TRUE) %>%
  kable_styling()
Site years
571005154134600 2005, 2006
571221154040300 2005
571343154244900 2006
572656154082400 2005, 2006
fws_kdk_aforv01 2009, 2010, 2011, 2012, 2013, 2014, 2016, 2017, 2018
fws_kdk_busrv01 2009, 2012, 2014, 2015, 2016, 2017
kdk_akacr01 2016, 2017
kdk_akacr02 2018
kdk_ayarv01 2016, 2017, 2018
kdk_ayarv03 2015, 2016, 2017, 2018
kdk_bigcr01 2016, 2018
kdk_busrv01 2016, 2017, 2018
kdk_cancr01 2015, 2016, 2017
kdk_cancr02 2018
kdk_cascr01 2015, 2016, 2017, 2018, 2019
kdk_concr01 2015, 2016, 2017, 2018, 2019
kdk_doscr01 2015, 2016, 2017, 2018, 2019
kdk_doscr02 2015, 2017, 2018, 2019
kdk_eftrv01 2015, 2016, 2017, 2018
kdk_falcr01 2015, 2017
kdk_karrv01 2015, 2016, 2017, 2018, 2019
kdk_karrv02 2016, 2017, 2018
kdk_meacr01 2015, 2016
kdk_olgcr01a 2016, 2017, 2019
kdk_omarv01 2015, 2016
kdk_pincr01 2015, 2016, 2017
kdk_pincr02 2018
kdk_relrv01 2015, 2016, 2017, 2018
kdk_soucr01 2015, 2017, 2018
usgs_15295700 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15297475 2018, 2019
mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_slope, log_cat_elev, log_cat_slope, 
         wtd_slope_MEAN, snow_ind, wtd_lcld_jd, summer_precip) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_area, dist_coast_km, wtd_north_per,
         asrt_wet, asrt_glac, asrt_lake, glac_10) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

Prince William Sound

region_in <- "Prince_William_Sound"

print(paste0(region_in, ": ", nrow(mod_dat %>% filter(Region == region_in) %>% distinct(Site)), " sites"))
## [1] "Prince_William_Sound: 20 sites"
mod_dat %>% 
  filter(Region == region_in) %>% 
  group_by(Site) %>% 
  summarize(years = paste(Year, collapse = ", ")) %>% 
  kable(longtable = TRUE) %>%
  kable_styling()
Site years
nv_Eyak_Hartney Creek 2016, 2017
nv_Eyak_Heney Creek 2017, 2018
PWSCC_Erb 2016, 2017, 2018
PWSCC_Gilmour 2016, 2019
PWSCC_Hogan 2018, 2019
PWSCC_Stockdale 2016, 2017, 2018, 2019
USFS_Eagle Creek 2014, 2015, 2016, 2017, 2018, 2019
USFS_ERB Creek 2019
USFS_Hell’s Hole Trib 2013, 2014, 2015, 2016, 2017, 2018, 2019
USFS_Jackpot River 2014, 2015, 2016, 2017
USFS_Koppen Creek 2013, 2014, 2015, 2016, 2017, 2018, 2019
USFS_Olsen Creek 2013, 2014, 2015, 2016, 2017, 2018
USFS_Pigot Bay Spawn Channel 2014, 2015, 2016, 2017
USFS_Rude River SC 2014, 2015, 2017, 2018
USFS_Sheep River 2013, 2014, 2015, 2016, 2017, 2018, 2019
USFS_Shelter Bay Trib 2013, 2014, 2015, 2016, 2017, 2018
USFS_Solf Lake Fish Pass 2012, 2013, 2014, 2015, 2016, 2017, 2018
USFS_Solf Lake Outlet Creek 2019
USFS_Stump Lake Outlet 2014, 2015, 2016, 2017, 2018
usgs_15236900 2016, 2017, 2018, 2019
mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_slope, log_cat_elev, log_cat_slope, 
         wtd_slope_MEAN, snow_ind, wtd_lcld_jd, summer_precip) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_area, dist_coast_km, wtd_north_per,
         asrt_wet, asrt_glac, asrt_lake, glac_10) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

Cook Inlet

region_in <- "Cook_Inlet"

print(paste0(region_in, ": ", nrow(mod_dat %>% filter(Region == region_in) %>% distinct(Site)), " sites"))
## [1] "Cook_Inlet: 211 sites"
mod_dat %>% 
  filter(Region == region_in) %>% 
  group_by(Site) %>% 
  summarize(years = paste(Year, collapse = ", ")) %>% 
  kable(longtable = TRUE) %>%
  kable_styling()
Site years
APU10 2015
APU11 2015
APU12 2015
APU5 2015
AR2 2006, 2007
BM1 2015, 2016
BM10 2015, 2016
BM11 2016
BM12 2016
BM13 2015
BM14 2016
BM2 2015, 2016
BM3 2015
BM6 2015
BM7 2016
BM8 2015, 2016
BM9 2015, 2016
CIK_0 2009, 2010, 2011, 2012
CIK_1 2008, 2009, 2010, 2011
CIK_10 2008, 2009, 2010, 2011, 2012, 2019
CIK_11 2008, 2009, 2010, 2011, 2012, 2014, 2015, 2019
CIK_12 2008, 2009, 2010, 2011, 2012, 2014, 2015
CIK_13 2008, 2009, 2010, 2011, 2014, 2015
CIK_14 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_15 2004, 2005, 2006, 2007, 2008, 2009, 2011
CIK_16 2009, 2010, 2011, 2012
CIK_17 2008, 2009, 2010, 2011, 2012
CIK_18 2009, 2010, 2011, 2012
CIK_19 2009, 2010, 2011, 2012
CIK_2 2008, 2009, 2010
CIK_20 2008, 2009, 2010, 2011, 2012
CIK_21 2008, 2009, 2010, 2011, 2012
CIK_22 2009, 2010
CIK_23 2008, 2009, 2010, 2011, 2012, 2014, 2015, 2019
CIK_24 2009, 2010, 2011, 2012
CIK_25 2008, 2010, 2012
CIK_26 2009, 2010, 2011, 2012
CIK_27 2008, 2009, 2010, 2011
CIK_28 2009, 2010, 2014, 2016, 2017
CIK_29 2008, 2009, 2010, 2012
CIK_3 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_30 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_31 2008, 2009, 2010, 2011, 2012
CIK_32 2009, 2010, 2011
CIK_33 2008, 2009, 2010, 2011
CIK_34 2009, 2011
CIK_35 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_36 2008, 2009, 2010, 2011
CIK_37 2008, 2009, 2010, 2011
CIK_38 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_39 2008, 2009, 2010, 2011, 2012
CIK_4 2008, 2009, 2010, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_40 2008, 2009, 2010, 2011, 2012
CIK_41 2008, 2009, 2010, 2012
CIK_42 2009, 2010
CIK_43 2008, 2009, 2011, 2012
CIK_44 2009
CIK_45 2011
CIK_46 2010, 2011
CIK_47 2009, 2010
CIK_48 2011
CIK_5 2008, 2009, 2010, 2011, 2012, 2014, 2015
CIK_6 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_7 2008, 2009, 2010, 2011
CIK_8 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
CIK_9 2008, 2009, 2010, 2011, 2012, 2014, 2015, 2019
CIK1 2005, 2006, 2007
CIK2 2005
CIK3 2005, 2006, 2007
CIK4 2005, 2006, 2007
CIK6 2005
Deshka 1 Downstream 2017, 2018, 2019
Deshka 1 Tributary 2017, 2018, 2019
Deshka 1 Upstream 2017, 2018
Deshka 2 Downstream 2018, 2019
Deshka 2 Tributary 2017, 2018, 2019
Deshka 2 Upstream 2017, 2018
Deshka 3 Downstream 2017, 2018, 2019
Deshka 3 Tributary 2017, 2018, 2019
Deshka 3 Upstream 2018
Deshka 4 Downstream 2017, 2019
Deshka 4 Tributary 2017, 2018, 2019
Deshka 4 Upstream 2017, 2018, 2019
Deshka 5 Downstream 2018, 2019
Deshka 5 Tributary 2017, 2018, 2019
Deshka 6 Downstream 2017, 2018, 2019
Deshka 6 Tributary 2017, 2018, 2019
Deshka 6 Upstream 2017, 2018, 2019
Kroto 1 Downstream 2017, 2018, 2019
Kroto 1 Tributary 2017, 2018, 2019
Kroto 1 Upstream 2017, 2018, 2019
Kroto 2 Downstream 2017, 2018, 2019
Kroto 2 Tributary 2017, 2018, 2019
Kroto 2 Upstream 2017, 2018, 2019
Kroto 3 Downstream 2017, 2018, 2019
Kroto 3 Tributary 2017, 2018, 2019
Kroto 3 Upstream 2017, 2018, 2019
Kroto 4 Downstream 2017, 2018, 2019
Kroto 4 Tributary 2017, 2018, 2019
Kroto 4 Upstream 2017, 2018, 2019
Kroto 5 Downstream 2017, 2018, 2019
Kroto 6 Downstream 2017, 2018, 2019
Kroto 6 Tributary 2018
Kroto 6 Upstream 2017, 2018, 2019
Kroto 7 Downstream 2017, 2018, 2019
Kroto 7 Tributary 2018, 2019
Kroto 7 Upstream 2017, 2018, 2019
Kroto 8 Downstream 2017, 2018
Kroto 8 Tributary 2017, 2018
Kroto 8 Upstream 2017, 2018, 2019
KWF1 2015, 2016
KWF2 2015, 2016
KWF3 2016
lsarc 2016
lscoh 2016
lslak 2016
lslak7 2016
lslil10 2016
lspap 2016
lsr103 2016
lsr112.2 2016
lsr112.4 2016
lsr28 2016
lsr33.1 2016
lsr33.8 2016
lsr48.1 2016
lsr48.3 2016
lsr63.1 2016
lsr63.4 2016
lsr73 2016
lsr73.1 2016
lsr87 2016
lstrb33 2016
Moose 1 Top of Study 2017, 2018, 2019
Moose 2 Downstream 2017, 2018, 2019
Moose 2 Tributary 2017, 2018, 2019
Moose 2 Upstream 2017, 2018, 2019
Moose 3 Downstream 2017, 2018, 2019
Moose 3 Tributary 2017, 2018
Moose 3 Upstream 2017, 2019
Moose 4 Downstream 2017, 2018, 2019
Moose 4 Tributary 2018, 2019
Moose 4 Upstream 2017, 2018, 2019
Moose 5 Downstream 2017, 2018, 2019
Moose 5 Tributary 2018, 2019
Moose 5 Upstream 2017, 2018
Moose 6 Downstream 2017, 2018, 2019
Moose 6 Tributary 2017, 2018, 2019
Moose 6 Upstream 2017, 2018, 2019
Moose 7 Downstream 2017, 2018, 2019
Moose 7 Tributary 2019
Moose 7 Upstream 2017, 2018, 2019
Moose 8 Downstream 2018, 2019
Moose 8 Tributary 2017, 2018, 2019
Moose 8 Upstream 2017, 2018, 2019
OMCT1 2019
OMCT2 2019
OMCT3 2019
OMCT4 2019
OWL1 2019
PGC1 2019
PGC2 2019
PGCT1 2019
PJ Mid 2012
PMC1 2019
PMC2 2019
PMCT1 2019
PNC1 2019
PNCT1 2019
PNCT2 2019
PNCT4 2019
PWMC1 2019
STAR 171 Lower 2012
STAR 171 Upper 2012
USFS_Bench Creek 2014, 2015, 2016, 2018, 2019
USFS_Center Creek 2015, 2016, 2017, 2018, 2019
USFS_Chickaloon Headwaters 2014, 2016, 2017
USFS_Crescent Creek 2014, 2015, 2016, 2017, 2018
USFS_Daves Creek 2014, 2015, 2016, 2017, 2018, 2019
USFS_Juneau Creek 2014, 2015, 2016, 2017, 2018
USFS_Quartz Creek 2014, 2015, 2016, 2017, 2018, 2019
USFS_Resurrection Creek 2014, 2015, 2016, 2017, 2018
usgs_15238984 2013
usgs_15238986 2011, 2018, 2019
usgs_15239070 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15241600 2001, 2002
usgs_15261000 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15266110 2001
usgs_15266300 2001, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15272380 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011
usgs_15274000 2001
usgs_15274600 2018, 2019
usgs_15276000 2015, 2016, 2017, 2018, 2019
usgs_15280999 2019
usgs_15283700 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15284000 2015, 2016, 2017, 2018, 2019
usgs_15285000 2010, 2011, 2012
usgs_15290000 2015, 2016, 2017, 2018, 2019
usgs_15291000 2012, 2013, 2014
usgs_15291700 2016
usgs_15292100 2012, 2014
usgs_15292400 2012, 2013, 2014, 2016
usgs_15292700 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
usgs_15292780 2012, 2013, 2014, 2015
usgs_15292800 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
usgs_15293200 2013, 2014, 2015, 2016, 2017, 2018
usgs_15293700 2013, 2014, 2015, 2016, 2017, 2018
usgs_15294005 2015, 2016, 2017, 2018, 2019
usgs_15294080 2017, 2018, 2019
usgs_15294345 2013, 2014
usgs_15294350 2013, 2014
mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_slope, log_cat_elev, log_cat_slope, 
         wtd_slope_MEAN, snow_ind, wtd_lcld_jd, summer_precip) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_area, dist_coast_km, wtd_north_per,
         asrt_wet, asrt_glac, asrt_lake, glac_10) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

Bristol Bay

region_in <- "Bristol_Bay"

print(paste0(region_in, ": ", nrow(mod_dat %>% filter(Region == region_in) %>% distinct(Site)), " sites"))
## [1] "Bristol_Bay: 118 sites"
mod_dat %>% 
  filter(Region == region_in) %>% 
  group_by(Site) %>% 
  summarize(years = paste(Year, collapse = ", ")) %>% 
  kable(longtable = TRUE) %>%
  kable_styling()
Site years
accs_AKBB-011 2015, 2016, 2017, 2018, 2019
accs_AKBB-020 2016, 2017, 2018, 2019
accs_AKBB-028 2015, 2016, 2017, 2018, 2019
accs_AKBB-029 2015, 2016, 2017, 2018, 2019
accs_AKBB-040 2016, 2017, 2018, 2019
accs_ilbig01 2018
accs_iltaz02 2016, 2017, 2018, 2019
accs_iltnr19 2013, 2014, 2015, 2016, 2017, 2018, 2019
accs_mubon10 2015, 2016, 2019
accs_muekm23 2013, 2014, 2015, 2016, 2017, 2018, 2019
accs_musfk01 2016, 2017, 2018, 2019
accs_mussm15 2013, 2014, 2015, 2016, 2017, 2018, 2019
accs_mustu17 2015, 2016, 2017, 2018, 2019
accs_mutsk02 2013, 2014, 2015, 2016, 2017, 2018, 2019
accs_mutsk09 2013, 2014, 2015, 2016, 2017, 2018, 2019
cik_Ben Courtney Creek 2017
cik_Big Creek 2014, 2015
cik_Copper River 2017, 2018
cik_Gibraltar River 2017, 2018
cik_Napotoli Creek 2014, 2015, 2016, 2017, 2018, 2019
cik_Neilson Creek 2014, 2015
cik_Panaruqak Creek 2015, 2017
cik_Roadhouse Creek 2018
cik_Silver Salmon Creek 2014, 2015, 2016, 2017, 2018
cik_Sivanguq Creek 2014, 2015, 2016, 2017
cik_Squaw Creek 2014, 2015
cik_Tunravik Creek 2014
cik_Yellow Creek 2015, 2016, 2017, 2018, 2019
fws_580223156504200 2015, 2016, 2017, 2018
fws_GELO 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012, 2013
fws_KULR 2002, 2003, 2006, 2007, 2008, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
fws_MALR 2003, 2006
fws_NCLO 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
fws_Newhalen River 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
fws_OSLR 2002, 2003, 2005
fws_OSLR2 2010, 2011, 2012, 2013, 2017, 2018
fws_PULO 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012, 2014, 2015, 2016, 2017, 2018, 2019
fws_PULR 2003, 2004, 2005, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2019
fws_SLLR 2005, 2006, 2007, 2008, 2011, 2014, 2015, 2016, 2017, 2018
fws_TOLO 2003, 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
fws_TOLR 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012, 2013, 2014, 2015, 2016
fws_WELR 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
fws_WELR2 2012, 2013, 2014, 2015, 2016, 2017
NPS_Chulitna_SiteB 2008, 2010, 2011
nps_KATM_idavc_stream_water 2017, 2018, 2019
nps_KATM_lbrooo 2006, 2007, 2008, 2012, 2013, 2018
nps_KATM_margc_stream_water 2015, 2017, 2019
nps_KATM_naknlo 2006, 2007, 2009, 2010, 2011
nps_KATM_savor_stream_water 2018, 2019
nps_KATM_upatc_stream_water 2015, 2016, 2017, 2018, 2019
nps_LACL_kijilo 2016
nps_LACL_tazir_stream_water 2015, 2018, 2019
nps_LACL_tlikr_stream_water 2015, 2016, 2017
NPS_Little_Kijik_River_Dan 2001, 2002, 2003, 2004
NPS_Newhalen_River 2008, 2009, 2010, 2014, 2015, 2016
NPS_Six_Mile_Outlet 2007, 2008
usgs_15298040 2010, 2011, 2013, 2014, 2015, 2016, 2017
usgs_15300100 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
usgs_15300250 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014, 2015, 2016
usgs_15300270 2012, 2013
usgs_15300300 2014, 2015, 2016, 2017, 2018, 2019
usgs_15300320 2011, 2012, 2013
usgs_15301500 2012, 2013, 2014
usgs_15302000 2014, 2015, 2016, 2017, 2018, 2019
usgs_15302200 2007, 2008, 2011, 2012, 2013, 2014, 2015, 2018, 2019
usgs_15302250 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2018, 2019
usgs_15302300 2014
usgs_15302320 2014
usgs_15302812 2017, 2018, 2019
UW_Agulowak River 2017
UW_Agulukpak River 2011, 2012, 2016, 2019
UW_Aleknagik Bear Creek 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
UW_Aleknagik Big Whitefish Creek 2011, 2012, 2013, 2014, 2015, 2016, 2018, 2019
UW_Aleknagik Eagle Creek 2011, 2012, 2014, 2015, 2016, 2017, 2018, 2019
UW_Aleknagik Hansen Creek 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
UW_Aleknagik Happy Creek 2011, 2012, 2015, 2016, 2018, 2019
UW_Aleknagik Ice Creek 2011, 2012, 2017, 2018, 2019
UW_Aleknagik Mission Creek 2011, 2012, 2016, 2018, 2019
UW_Aleknagik Pfifer Creek 2011, 2012, 2016, 2017, 2018, 2019
UW_Aleknagik Silver Salmon Creek 2011, 2012, 2015, 2016, 2017, 2018, 2019
UW_Aleknagik Squaw Creek 2016
UW_Aleknagik Sunshine Creek 2014
UW_Aleknagik Yako Creek 2011, 2012, 2015, 2016, 2017, 2018, 2019
UW_Aleknagik Youth Creek 2016
UW_Beverley Hope Creek 2013, 2016, 2017, 2018
UW_Beverley Moose Creek 2013, 2015, 2016, 2017, 2018
UW_Beverley Silverhorn Creek 2013
UW_Beverley Uno Creek 2013, 2016
UW_Kulik Grant River 2016, 2017, 2018
UW_Kulik K-3 Creek 2012, 2013, 2015, 2018, 2019
UW_Kulik Kulik Creek 2016, 2019
UW_Little Togiak C Creek 2011, 2012, 2014, 2015, 2016, 2017, 2018, 2019
UW_Little Togiak Creek 2016, 2017, 2018, 2019
UW_Nerka Allah Creek 2011, 2012, 2014, 2015, 2016, 2017, 2018
UW_Nerka Bear Creek 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
UW_Nerka Beaver Creek 2011, 2012
UW_Nerka Berm Creek 2012, 2013, 2014, 2015, 2016, 2018, 2019
UW_Nerka Bug Creek 2011
UW_Nerka Cabin Creek 2012, 2013, 2014, 2016, 2018
UW_Nerka Chamee Creek 2016
UW_Nerka Cottonwood Creek 2012, 2013, 2014, 2016, 2019
UW_Nerka Elva Creek 2013, 2014, 2016, 2017, 2018, 2019
UW_Nerka Fenno Creek 2011, 2012, 2016, 2017, 2018, 2019
UW_Nerka Hidden Lake Creek 2011, 2012, 2013, 2015, 2016, 2017, 2018, 2019
UW_Nerka Joe Creek 2011, 2012, 2013, 2014, 2015, 2016, 2018
UW_Nerka Kema Creek 2011, 2013, 2014, 2015, 2016, 2017, 2018, 2019
UW_Nerka Little Togiak River 2010, 2012
UW_Nerka Lynx Creek 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
UW_Nerka Lynx Creek Cold Tributary 2011, 2012, 2013, 2014, 2016, 2017, 2019
UW_Nerka Lynx Lake Tributary 2017, 2019
UW_Nerka N4 Creek 2016, 2017, 2018, 2019
UW_Nerka Pick Creek 2012, 2013, 2014, 2015, 2016, 2018, 2019
UW_Nerka Rainbow Creek 2012, 2013, 2014, 2016, 2017, 2018
UW_Nerka Sam Creek 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019
UW_Nerka Seventh Creek 2011, 2012, 2013, 2015, 2016, 2017
UW_Nerka Sixth Creek 2011, 2012, 2013
UW_Nerka Stovall Creek 2011, 2012, 2013, 2014, 2016, 2017, 2018, 2019
UW_Nerka Teal Creek 2012, 2013, 2014, 2015, 2016, 2018, 2019
mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_slope, log_cat_elev, log_cat_slope, 
         wtd_slope_MEAN, snow_ind, wtd_lcld_jd, summer_precip) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

mod_dat %>% 
  filter(Region == region_in) %>% 
  select(TempSens, log_area, dist_coast_km, wtd_north_per,
         asrt_wet, asrt_glac, asrt_lake, glac_10) %>% 
  pairs(upper.panel = panel.cor, diag.panel = panel.hist, lower.panel = panel.smooth)

9 Prediction scenarios

Spatial domain: salmon habitat for all regions. Select HU12 that intersect anadromous waters catalog. Spatial scale: suggest using stream outlets associated with HU12 boundaries (smallest are 25 km2). We can use these outlets to create watersheds and calculate all the same covariates for prediction.

Temporal scenarios: Ideas for our scenarios include picking years within our temporal domain (2001-2019) that represent contrasting conditions that affect TS (e.g. low and high snow years). One problem with this idea is that conditions could vary across our study area so a high snow year in Bristol Bay may not match Copper. Alternatively, we could develop scenarios for prediction using high and low ranges of snowpack or precipitation for each region.

Comparison of standardized (subtract mean and divide by sd) temperature and precipitation values by different regions:

  • 2019 warm and low precipitation
  • 2016 warm and high precipitation
  • 2006 cold and high precipitation
  • 2017 and 2009 about normal years for both
clim_dat <- readRDS("output/clim_dat.rds")

scale_var <- function(x){
  (x - mean(x, na.rm=TRUE)) / sd(x, na.rm=TRUE)
}

#deviations from normal
clim_dat %>% 
  group_by(Region, parameter) %>% 
  dplyr::mutate(Value_metric_sc = scale_var(Value_metric)) %>% 
  ggplot(aes(x = Year, y = Value_metric_sc, color = Region)) +
  geom_line() +
  scale_x_continuous(breaks = c(seq(2000, 2019, 2))) +
  facet_wrap(~parameter, scales = "free", ncol = 1) +
  geom_hline(aes(yintercept = 0)) +
  theme_bw() +
  theme(legend.position = "right") +
  labs(y = "Standardized values")

Snowtel data indicate April 1st SWE (magnitude of spring snowpack) for different sites across some of our regions. Note that there were no snowtel sites with data for Bristol Bay or Kodiak. From Tim’s paper, 2012 and 2013 were high snow years and 2015 was a low snow year.

  • 2012 was a high snow year
  • 2015 was a low snow year
snowtel <- readRDS("output/snowtel.rds")

#deviations from normal
snowtel %>% 
  filter(!grepl("Gulk|Tela", Snowtel_site)) %>% 
  group_by(Snowtel_site) %>% 
  mutate(swe_sc = scale_var(Apr1_SWE)) %>% 
  ggplot(aes(x = Year, y = swe_sc, color = Snowtel_site)) +
  geom_line() +
  scale_x_continuous(breaks = c(seq(2000, 2019, 2))) +
  theme_bw() +
  theme(legend.position = "right") +
  geom_hline(aes(yintercept = 0)) +
  facet_wrap(~Region, ncol = 1) +
  labs(y = "Standardized values")